View Javadoc

1   package org.apache.continuum.dao;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.continuum.model.project.BuildDefinition;
23  import org.apache.maven.continuum.model.project.Project;
24  import org.apache.maven.continuum.model.project.ProjectGroup;
25  import org.apache.maven.continuum.store.ContinuumStoreException;
26  
27  import java.util.List;
28  import java.util.Map;
29  
30  /**
31   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
32   * @version $Id: BuildDefinitionDao.java 751594 2009-03-09 06:07:19Z evenisse $
33   */
34  public interface BuildDefinitionDao
35  {
36      BuildDefinition getBuildDefinition( int buildDefinitionId )
37          throws ContinuumStoreException;
38  
39      void removeBuildDefinition( BuildDefinition buildDefinition )
40          throws ContinuumStoreException;
41  
42      BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
43          throws ContinuumStoreException;
44  
45      BuildDefinition addBuildDefinition( BuildDefinition buildDefinition )
46          throws ContinuumStoreException;
47  
48      List<BuildDefinition> getAllBuildDefinitions()
49          throws ContinuumStoreException;
50  
51      /**
52       * Returns the default build definition of all projects. The key is the project id and the value is the build
53       * definition id.
54       *
55       * @return a map of all default build definitions
56       */
57      Map<Integer, Integer> getDefaultBuildDefinitions();
58  
59      /**
60       * returns the default build definitions for the project group and there
61       * should always be at least one declared.
62       *
63       * @param projectGroupId The project group id
64       * @return The list of default build definitions
65       * @throws ContinuumStoreException if the build definitions list can't be obtain
66       */
67      List<BuildDefinition> getDefaultBuildDefinitionsForProjectGroup( int projectGroupId )
68          throws ContinuumStoreException;
69  
70      /**
71       * returns the default build definitions for the project group and there
72       * should always be at least one declared.
73       *
74       * @param projectGroup The project group
75       * @return The list of default build definitions
76       * @throws ContinuumStoreException if the build definitions list can't be obtain
77       */
78      List<BuildDefinition> getDefaultBuildDefinitionsForProjectGroup( ProjectGroup projectGroup )
79          throws ContinuumStoreException;
80  
81      /**
82       * returns the default build definition of the project, if the project
83       * doesn't have on declared the default of the project group will be
84       * returned <p/> this should be the most common usage of the default build
85       * definition accessing methods
86       *
87       * @param projectId
88       * @return
89       * @throws ContinuumStoreException
90       * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException
91       *
92       */
93      BuildDefinition getDefaultBuildDefinitionForProject( int projectId )
94          throws ContinuumStoreException;
95  
96      /**
97       * returns the default build definition for the project without consulting
98       * the project group
99       *
100      * @param project
101      * @return
102      * @throws ContinuumStoreException
103      * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException
104      *
105      */
106     BuildDefinition getDefaultBuildDefinitionForProject( Project project )
107         throws ContinuumStoreException;
108 
109     /**
110      * returns the default build definition of the project, if the project
111      * doesn't have on declared the default of the project group will be
112      * returned <p/> this should be the most common usage of the default build
113      * definition accessing methods
114      *
115      * @param projectId
116      * @return
117      * @throws ContinuumStoreException
118      * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException
119      *
120      */
121     BuildDefinition getDefaultBuildDefinition( int projectId )
122         throws ContinuumStoreException;
123 
124     List<BuildDefinition> getAllTemplates()
125         throws ContinuumStoreException;
126 
127     List<BuildDefinition> getBuildDefinitionsBySchedule( int scheduleId );
128 }