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.Project;
23 import org.apache.maven.continuum.model.project.ProjectGroup;
24 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
25 import org.apache.maven.continuum.store.ContinuumStoreException;
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 1372260 2012-08-13 04:29:09Z brett $
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
57 * if the project group can't be obtain
58 */
59 ProjectGroup getProjectGroup( int projectGroupId )
60 throws ContinuumStoreException, ContinuumObjectNotFoundException;
61
62 /**
63 * Return the project group associated to the groupId parameter.
64 *
65 * @param groupId The group id
66 * @return The project group
67 * @throws ContinuumStoreException if the project group can't be obtain
68 */
69 ProjectGroup getProjectGroupByGroupId( String groupId )
70 throws ContinuumStoreException;
71
72 /**
73 * Return the project group associated to the groupId parameter.
74 *
75 * @param groupId The group id
76 * @return The project group
77 * @throws ContinuumStoreException if the project group can't be obtain
78 */
79 ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
80 throws ContinuumStoreException;
81
82 /**
83 * Return the project group associated to the groupId parameter.
84 *
85 * @param groupId The group id
86 * @return The project group
87 * @throws ContinuumStoreException if the project group can't be obtain
88 */
89 ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId )
90 throws ContinuumStoreException;
91
92 /**
93 * Return the project group of the project.
94 *
95 * @param projectId The project id
96 * @return The project group
97 * @throws ContinuumObjectNotFoundException
98 * if the project group can't be obtain
99 */
100 ProjectGroup getProjectGroupByProjectId( int projectId )
101 throws ContinuumObjectNotFoundException;
102
103 /**
104 * Return the project group of the project.
105 *
106 * @param project The project
107 * @return The project group
108 * @throws ContinuumObjectNotFoundException
109 * if the project group can't be obtain
110 */
111 ProjectGroup getProjectGroupByProject( Project project )
112 throws ContinuumObjectNotFoundException;
113
114 /**
115 * Save the modified project group.
116 *
117 * @param projectGroup The project group
118 * @throws ContinuumStoreException if the project group can't be saved
119 */
120 void updateProjectGroup( ProjectGroup projectGroup )
121 throws ContinuumStoreException;
122
123 /**
124 * Return the project group with projects populated.
125 *
126 * @param projectGroupId The project group id
127 * @return All project groups
128 * @throws ContinuumStoreException if the project group can't be obtain
129 */
130 ProjectGroup getProjectGroupWithProjects( int projectGroupId )
131 throws ContinuumStoreException;
132
133 /**
134 * Return all project groups with projects populated.
135 *
136 * @return All project groups
137 */
138 Collection<ProjectGroup> getAllProjectGroupsWithProjects();
139
140 /**
141 * Return all project groups with build details populated.
142 *
143 * @return All project groups
144 */
145 List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
146
147 /**
148 * Return all project groups.
149 *
150 * @return All project groups
151 */
152 Collection<ProjectGroup> getAllProjectGroups();
153
154 /**
155 * Return all project groups with all associated objects populated. This method return the majority of the database.
156 *
157 * @return all project groups
158 */
159 Collection<ProjectGroup> getAllProjectGroupsWithTheLot();
160
161 /**
162 * Return the project group with associated build details populated.
163 *
164 * @param projectGroupId the project group id
165 * @return the project group
166 * @throws ContinuumStoreException if the project group can't be obtain
167 */
168 ProjectGroup getProjectGroupWithBuildDetailsByProjectGroupId( int projectGroupId )
169 throws ContinuumStoreException;
170
171 List<ProjectGroup> getProjectGroupByRepository( int repositoryId );
172 }