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.ProjectGroup;
23  import org.apache.maven.continuum.model.project.Project;
24  import org.apache.maven.continuum.store.ContinuumStoreException;
25  import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
26  
27  import java.util.Collection;
28  import java.util.List;
29  
30  /**
31   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
32   * @version $Id: ProjectGroupDao.java 684085 2008-08-08 20:48:14Z evenisse $
33   */
34  public interface ProjectGroupDao
35  {
36      /**
37       * Add the project group.
38       *
39       * @param group The project group
40       * @return The project group added
41       */
42      ProjectGroup addProjectGroup( ProjectGroup group );
43  
44      /**
45       * Remove the project group.
46       *
47       * @param projectGroup the project group to remove
48       */
49      void removeProjectGroup( ProjectGroup projectGroup );
50  
51      /**
52       * Return the project group associated to the project group id parameter.
53       *
54       * @param projectGroupId The project group id
55       * @return The project group
56       * @throws org.apache.maven.continuum.store.ContinuumStoreException if the project group can't be obtain
57       */
58      ProjectGroup getProjectGroup( int projectGroupId )
59          throws ContinuumStoreException, ContinuumObjectNotFoundException;
60  
61      /**
62       * Return the project group associated to the groupId parameter.
63       *
64       * @param groupId The group id
65       * @return The project group
66       * @throws ContinuumStoreException if the project group can't be obtain
67       */
68      ProjectGroup getProjectGroupByGroupId( String groupId )
69          throws ContinuumStoreException;
70  
71      /**
72       * Return the project group associated to the groupId parameter.
73       *
74       * @param groupId The group id
75       * @return The project group
76       * @throws ContinuumStoreException if the project group can't be obtain
77       */
78      ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
79          throws ContinuumStoreException;
80  
81      /**
82       * Return the project group associated to the groupId parameter.
83       *
84       * @param groupId The group id
85       * @return The project group
86       * @throws ContinuumStoreException if the project group can't be obtain
87       */
88      ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId )
89          throws ContinuumStoreException;
90  
91      /**
92       * Return the project group of the project.
93       *
94       * @param projectId The project id
95       * @return The project group
96       * @throws ContinuumObjectNotFoundException
97       *          if the project group can't be obtain
98       */
99      ProjectGroup getProjectGroupByProjectId( int projectId )
100         throws ContinuumObjectNotFoundException;
101 
102     /**
103      * Return the project group of the project.
104      *
105      * @param project The project
106      * @return The project group
107      * @throws ContinuumObjectNotFoundException
108      *          if the project group can't be obtain
109      */
110     ProjectGroup getProjectGroupByProject( Project project )
111         throws ContinuumObjectNotFoundException;
112 
113     /**
114      * Save the modified project group.
115      *
116      * @param projectGroup The project group
117      * @throws ContinuumStoreException if the project group can't be saved
118      */
119     void updateProjectGroup( ProjectGroup projectGroup )
120         throws ContinuumStoreException;
121 
122     /**
123      * Return the project group with projects populated.
124      *
125      * @param projectGroupId The project group id
126      * @return All project groups
127      * @throws ContinuumStoreException if the project group can't be obtain
128      */
129     ProjectGroup getProjectGroupWithProjects( int projectGroupId )
130         throws ContinuumStoreException;
131 
132     /**
133      * Return all project groups with projects populated.
134      *
135      * @return All project groups
136      */
137     Collection<ProjectGroup> getAllProjectGroupsWithProjects();
138 
139     /**
140      * Return all project groups with build details populated.
141      *
142      * @return All project groups
143      */
144     List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
145 
146     /**
147      * Return all project groups.
148      *
149      * @return All project groups
150      */
151     Collection<ProjectGroup> getAllProjectGroups();
152 
153     /**
154      * Return all project groups with all associated objects populated. This method return the majority of the database.
155      *
156      * @return all project groups
157      */
158     Collection<ProjectGroup> getAllProjectGroupsWithTheLot();
159 
160     /**
161      * Return the project group with associated build details populated.
162      *
163      * @param projectGroupId the project group id
164      * @return the project group
165      * @throws ContinuumStoreException if the project group can't be obtain
166      */
167     ProjectGroup getProjectGroupWithBuildDetailsByProjectGroupId( int projectGroupId )
168         throws ContinuumStoreException;
169 
170     List<ProjectGroup> getProjectGroupByRepository( int repositoryId );
171 }