Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 5035 invoked from network); 24 Dec 2006 00:26:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Dec 2006 00:26:06 -0000 Received: (qmail 7052 invoked by uid 500); 24 Dec 2006 00:26:13 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 7025 invoked by uid 500); 24 Dec 2006 00:26:13 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 7011 invoked by uid 99); 24 Dec 2006 00:26:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Dec 2006 16:26:13 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Dec 2006 16:26:05 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 877241A981A; Sat, 23 Dec 2006 16:25:14 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r489957 - /maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Date: Sun, 24 Dec 2006 00:25:14 -0000 To: continuum-commits@maven.apache.org From: rinku@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061224002514.877241A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rinku Date: Sat Dec 23 16:25:13 2006 New Revision: 489957 URL: http://svn.apache.org/viewvc?view=rev&rev=489957 Log: o refactored Store contract to use the composite GroupProjectKey. Modified: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Modified: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?view=diff&rev=489957&r1=489956&r2=489957 ============================================================================== --- maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (original) +++ maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Sat Dec 23 16:25:13 2006 @@ -35,6 +35,7 @@ * @author Trygve Laugstøl * @version $Id$ * @todo remove old stuff + * @todo review some of the method names */ public interface ContinuumStore { @@ -49,13 +50,17 @@ Map getDefaultBuildDefinitions(); /** - * returns the default build definition of the project, if the project doesn't have on declared the default - * of the project group will be returned - *

- * this should be the most common usage of the default build definition accessing methods + * Returns the default build definition of the project, if the project + * doesn't have a build definition declared then the default for the + * project group will be returned. + *

+ * This should be the most common usage of the default build definition + * accessing methods * - * @param groupProjectKey - * @return + * @param groupProjectKey Composite key that identifies the target project + * under a group. + * @return the build definitions for the entity specified by the composite + * {@link GroupProjectKey}. * @throws ContinuumStoreException * @throws ContinuumObjectNotFoundException * @@ -64,27 +69,32 @@ throws ContinuumStoreException, ContinuumObjectNotFoundException; /** - * returns the default build definition for the project without consulting the project group + * Returns the default build definition for the project without consulting + * the project group * - * @param projectId - * @return + * @param groupProjectKey Composite key that identifies the target project + * under a group. + * @return the build definitions for the {@link Project} specified by the + * composite {@link GroupProjectKey}. * @throws ContinuumStoreException * @throws ContinuumObjectNotFoundException * */ - BuildDefinition getDefaultBuildDefinitionForProject( int projectId ) + BuildDefinition getDefaultBuildDefinitionForProject( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; /** - * returns the default build definition for the project group and there should always be one declared + * Returns the default build definition for the {@link ProjectGroup} and + * there should always be one declared. * - * @param projectGroupId - * @return + * @param groupProjectKey Composite key that identifies the target project + * group. + * @return {@link BuildDefinition} for the specified {@link ProjectGroup}. * @throws ContinuumStoreException * @throws ContinuumObjectNotFoundException * */ - BuildDefinition getDefaultBuildDefinitionForProjectGroup( int projectGroupId ) + BuildDefinition getDefaultBuildDefinitionForProjectGroup( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; BuildDefinition getBuildDefinition( int buildDefinitionId ) @@ -98,10 +108,32 @@ ProjectGroup addProjectGroup( ProjectGroup group ); - ProjectGroup getProjectGroup( int projectGroupId ) + /** + * Obtains and returns a {@link ProjectGroup} instance that matches the + * Project Group specified by the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} instance that matches the group key + * specified by {@link GroupProjectKey}. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + ProjectGroup getProjectGroup( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; - public ProjectGroup getProjectGroupByProjectId( int projectId ) + /** + * Obtains and returns a {@link ProjectGroup} instance that matches the + * Project Group for the {@link Project} specified by the passed in + * {@link GroupProjectKey#getProjectKey()}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return {@link ProjectGroup} instance that matches the specified group + * key. + * @throws ContinuumObjectNotFoundException + */ + public ProjectGroup getProjectGroupByProjectId( GroupProjectKey groupProjectKey ) throws ContinuumObjectNotFoundException; void updateProjectGroup( ProjectGroup group ) @@ -115,7 +147,17 @@ List getAllProjectsByNameWithDependencies(); - public List getProjectsWithDependenciesByGroupId( int projectGroupId ); + /** + * Obtains and returns a list of all {@link Project}s and their + * dependencies for the group key specified by the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group. + * @return list of all {@link Project}s and dependencies that + * match the specified group key. + */ + public List getProjectsWithDependenciesByGroupId( GroupProjectKey groupProjectKey ); List getAllProjectsByNameWithBuildDetails(); @@ -137,11 +179,36 @@ List getAllInstallations(); - List getAllBuildsForAProjectByDate( int projectId ); + /** + * Returns a list of all the builds for a {@link Project}, ordered by date. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return List of all builds for the specified project, ordered by date. + */ + List getAllBuildsForAProjectByDate( GroupProjectKey groupProjectKey ); - Project getProject( int projectId ) + /** + * Returns a {@link Project} instance for the specified project key. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return {@link Project} instance for the specified project key. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + Project getProject( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; + /** + * TODO: Candidate for refactoring - check with Jesse? + * + * @param groupId + * @param artifactId + * @param version + * @return + * @throws ContinuumStoreException + */ Project getProject( String groupId, String artifactId, String version ) throws ContinuumStoreException; @@ -166,14 +233,35 @@ void updateSchedule( Schedule schedule ) throws ContinuumStoreException; - Project getProjectWithBuilds( int projectId ) + /** + * Returns a {@link Project} instance for the specified + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return {@link Project} instance that matches the passed in + * {@link GroupProjectKey. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + Project getProjectWithBuilds( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; void removeProfile( Profile profile ); void removeSchedule( Schedule schedule ); - Project getProjectWithCheckoutResult( int projectId ) + /** + * TODO: document! + * + * @param groupProjectkey Composite key that identifies the target project + * to be looked up. + * @return {@link Project} instance that matches the specified + * {@link GroupProjectKey}. + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + Project getProjectWithCheckoutResult( GroupProjectKey groupProjectkey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; BuildResult getBuildResult( int buildId ) @@ -183,20 +271,67 @@ void removeProjectGroup( ProjectGroup projectGroup ); - ProjectGroup getProjectGroupWithBuildDetails( int projectGroupId ) + /** + * Return the {@link ProjectGroup} instance that matches the group key + * specified by the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} instance that matches the group key passed + * in {@link GroupProjectKey} + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + ProjectGroup getProjectGroupWithBuildDetails( GroupProjectKey groupProjectKey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; - List getProjectsInGroup( int projectGroupId ) + /** + * Returns a list of all the {@link Project}s within a + * {@link ProjectGroup}. The {@link ProjectGroup} is determined from the + * passed in {@link GroupProjectKey}. + * + * @param groupProjectkey Composite key that identifies the target project + * group to be looked up. + * @return List of all the {@link Project} instances for the specified + * {@link ProjectGroup}. + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + List getProjectsInGroup( GroupProjectKey groupProjectkey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; - ProjectGroup getProjectGroupWithProjects( int projectGroupId ) + /** + * Returns a {@link ProjectGroup} instance along with its member + * {@link Project}s for the specified group key. The group key is + * determined from the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} instance along with the member + * {@link Project}s for the specified group key. + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + ProjectGroup getProjectGroupWithProjects( GroupProjectKey groupProjectKey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; List getAllProjectGroupsWithBuildDetails(); List getAllProjectsWithAllDetails(); - Project getProjectWithAllDetails( int projectId ) + /** + * Returns a {@link Project} instance along with all its details for the + * specified composite project key. The project key can be determined from + * the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link Project} instance with all its details for the specified + * project key. + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + Project getProjectWithAllDetails( GroupProjectKey groupProjectKey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; Schedule getSchedule( int scheduleId ) @@ -205,24 +340,109 @@ Profile getProfile( int profileId ) throws ContinuumObjectNotFoundException, ContinuumStoreException; - ProjectGroup getProjectGroupByGroupId( String groupId ) + /** + * Returns a {@link ProjectGroup} for the specified group key. The group + * key can be determined from the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} instance that matches the passed group key. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + ProjectGroup getProjectGroupByGroupId( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; - ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId ) + /** + * Returns a {@link ProjectGroup} instance along with all the build details + * for that group, for the specified group key. The group key can be + * determined from the {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} instance along with all the build details + * for the specified group key sourced from the passed in + * {@link GroupProjectKey}. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + ProjectGroup getProjectGroupByGroupIdWithBuildDetails( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; - ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId ) + /** + * Returns a {@link ProjectGroup} instance along with its member + * {@link Project} instances for the specified group key. The group can be + * determined from the passed in {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * group to be looked up. + * @return {@link ProjectGroup} along with its member {@link Project}s that + * matches the specified group key. + * @throws ContinuumStoreException + * @throws ContinuumObjectNotFoundException + */ + ProjectGroup getProjectGroupByGroupIdWithProjects( GroupProjectKey groupProjectKey ) throws ContinuumStoreException, ContinuumObjectNotFoundException; - BuildResult getLatestBuildResultForProject( int projectId ); + /** + * Returns the {@link BuildResult} for a {@link Project} determined by the + * project key. The project key can be determined from the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return {@link BuildResult} for the {@link Project} that matches the + * project key source from passed in {@link GroupProjectKey}. + */ + BuildResult getLatestBuildResultForProject( GroupProjectKey groupProjectKey ); - List getBuildResultsInSuccessForProject( int projectId, long fromDate ); + /** + * Returns a list of all the {@link BuildResult} instances for a specified + * {@link Project} where the result was a SUCCESS. + *

+ * The target project's key is determined from the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @param fromDate start date to filter out any older build results. + * @return list of build results for the specified project that are newer + * than the time specified. + */ + List getBuildResultsInSuccessForProject( GroupProjectKey groupProjectKey, long fromDate ); - List getBuildResultsForProject( int projectId, long fromDate ); + /** + * Returns a List of all {@link BuildResult} instances for a specified + * {@link Project} irrespective of the result type. + *

+ * The target project's key is determined from the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @param fromDate start date to filter out any older build results. + * @return list of build results for the specified project that are newer + * than the time specified and have SUCCESS state. + */ + List getBuildResultsForProject( GroupProjectKey groupProjectKey, long fromDate ); Map getLatestBuildResults(); - List getBuildResultByBuildNumber( int projectId, int buildNumber ); + /** + * Returns a list of all the {@link BuildResult} instances for a specified + * {@link Project} and given a build number. (TODO: Is this the Build + * definition Id?). + *

+ * The project key is determined from the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @param buildNumber TODO: Document! + * @return List of all the {@link BuildResult} instances for the specified + * project and a build number. + */ + List getBuildResultByBuildNumber( GroupProjectKey groupProjectKey, int buildNumber ); Map getBuildResultsInSuccess(); @@ -232,7 +452,19 @@ void updateBuildResult( BuildResult build ) throws ContinuumStoreException; - Project getProjectWithBuildDetails( int projectId ) + /** + * Returns a {@link Project} along with build details, that matches the + * specified project key. The project key is determined from the passed in + * {@link GroupProjectKey}. + * + * @param groupProjectKey Composite key that identifies the target project + * to be looked up. + * @return {@link Project} instance along with its build details, that + * matches the specified {@link Project} key. + * @throws ContinuumObjectNotFoundException + * @throws ContinuumStoreException + */ + Project getProjectWithBuildDetails( GroupProjectKey groupProjectKey ) throws ContinuumObjectNotFoundException, ContinuumStoreException; SystemConfiguration addSystemConfiguration( SystemConfiguration systemConf );