continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r580071 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Date Thu, 27 Sep 2007 15:58:12 GMT
Author: evenisse
Date: Thu Sep 27 08:58:07 2007
New Revision: 580071

URL: http://svn.apache.org/viewvc?rev=580071&view=rev
Log:
more java5 types

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=580071&r1=580070&r2=580071&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Thu Sep 27 08:58:07 2007
@@ -19,10 +19,6 @@
  * under the License.
  */
 
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -34,6 +30,10 @@
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -100,13 +100,13 @@
 
     BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
         throws ContinuumStoreException;
-    
+
     BuildDefinition addBuildDefinition( BuildDefinition buildDefinition )
         throws ContinuumStoreException;
-    
+
     List<BuildDefinition> getAllBuildDefinitions()
         throws ContinuumStoreException;
-    
+
     List<BuildDefinition> getAllTemplates()
         throws ContinuumStoreException;
 
@@ -130,10 +130,10 @@
         throws ContinuumStoreException;
 
     public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String
type )
-        throws ContinuumStoreException;    
-    
+        throws ContinuumStoreException;
+
     public List<BuildDefinitionTemplate> getContinuumBuildDefinitionTemplates()
-        throws ContinuumStoreException;    
+        throws ContinuumStoreException;
 
     /**
      * @param type
@@ -145,7 +145,8 @@
 
     /**
      * the list returned will contains only continuumDefaults {@link BuildDefinition}
-     * @return List<BuildDefinitionTemplate> 
+     *
+     * @return List<BuildDefinitionTemplate>
      * @throws ContinuumStoreException
      */
     List<BuildDefinitionTemplate> getContinuumDefaultdDefinitions()
@@ -166,19 +167,19 @@
     void updateProjectGroup( ProjectGroup group )
         throws ContinuumStoreException;
 
-    Collection getAllProjectGroupsWithProjects();
+    Collection<ProjectGroup> getAllProjectGroupsWithProjects();
 
-    Collection getAllProjectGroups();
+    Collection<ProjectGroup> getAllProjectGroups();
 
-    List getAllProjectsByName();
+    List<Project> getAllProjectsByName();
 
-    List getAllProjectsByNameWithDependencies();
+    List<Project> getAllProjectsByNameWithDependencies();
 
-    public List getProjectsWithDependenciesByGroupId( int projectGroupId );
+    public List<Project> getProjectsWithDependenciesByGroupId( int projectGroupId );
 
-    List getAllProjectsByNameWithBuildDetails();
+    List<Project> getAllProjectsByNameWithBuildDetails();
 
-    List getAllSchedulesByName();
+    List<Schedule> getAllSchedulesByName();
 
     Schedule addSchedule( Schedule schedule );
 
@@ -191,7 +192,7 @@
     // ----------------------------------------------------------------
     // Profile
     // ----------------------------------------------------------------    
-    List getAllProfilesByName();
+    List<Profile> getAllProfilesByName();
 
     Profile addProfile( Profile profile );
 
@@ -210,7 +211,7 @@
     // Installation
     // ----------------------------------------------------------------  
 
-    List getAllInstallations()
+    List<Installation> getAllInstallations()
         throws ContinuumStoreException;
 
     void removeInstallation( Installation installation )
@@ -222,7 +223,7 @@
     Installation getInstallation( int installationId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
-    List getAllBuildsForAProjectByDate( int projectId );
+    List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
 
     Project getProject( int projectId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
@@ -258,7 +259,7 @@
 
     BuildResult getBuildResult( int buildId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
-    
+
     void removeBuildResult( BuildResult buildResult );
 
     void removeProject( Project project );
@@ -268,18 +269,18 @@
     ProjectGroup getProjectGroupWithBuildDetailsByProjectGroupId( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
-    List getProjectsInGroup( int projectGroupId )
+    List<Project> getProjectsInGroup( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
-    List getProjectsInGroupWithDependencies( int projectGroupId )
+    List<Project> getProjectsInGroupWithDependencies( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
     ProjectGroup getProjectGroupWithProjects( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
-    List getAllProjectGroupsWithBuildDetails();
+    List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
 
-    List getAllProjectsWithAllDetails();
+    List<Project> getAllProjectsWithAllDetails();
 
     Project getProjectWithAllDetails( int projectId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
@@ -300,15 +301,15 @@
 
     BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId
);
 
-    List getBuildResultsInSuccessForProject( int projectId, long fromDate );
+    List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate
);
 
-    List getBuildResultsForProject( int projectId, long fromDate );
+    List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
 
     Map getLatestBuildResultsByProjectGroupId( int projectGroupId );
 
     Map getLatestBuildResults();
 
-    List getBuildResultByBuildNumber( int projectId, int buildNumber );
+    List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
 
     Map getBuildResultsInSuccess();
 
@@ -333,7 +334,7 @@
 
     void closeStore();
 
-    Collection getAllProjectGroupsWithTheLot();
+    Collection<ProjectGroup> getAllProjectGroupsWithTheLot();
 
     void eraseDatabase();
 }

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=580071&r1=580070&r2=580071&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Thu Sep 27 08:58:07 2007
@@ -1089,32 +1089,30 @@
         }
     }
 
-    public Collection getAllProjectGroupsWithProjects()
+    public Collection<ProjectGroup> getAllProjectGroupsWithProjects()
     {
         return getAllObjectsDetached( ProjectGroup.class, "name ascending", PROJECTGROUP_PROJECTS_FETCH_GROUP
);
     }
 
-    public Collection getAllProjectGroups()
+    public Collection<ProjectGroup> getAllProjectGroups()
     {
         return getAllObjectsDetached( ProjectGroup.class, "name ascending", null );
     }
 
-    public List getAllProjectsByName()
+    public List<Project> getAllProjectsByName()
     {
         return getAllObjectsDetached( Project.class, "name ascending", null );
     }
 
     // todo get this natively supported in the store
-    public List getProjectsWithDependenciesByGroupId( int projectGroupId )
+    public List<Project> getProjectsWithDependenciesByGroupId( int projectGroupId )
     {
-        List allProjects = getAllObjectsDetached( Project.class, "name ascending", PROJECT_DEPENDENCIES_FETCH_GROUP
);
+        List<Project> allProjects = getAllObjectsDetached( Project.class, "name ascending",
PROJECT_DEPENDENCIES_FETCH_GROUP );
 
-        List groupProjects = new ArrayList();
+        List<Project> groupProjects = new ArrayList<Project>();
 
-        for ( Iterator i = allProjects.iterator(); i.hasNext(); )
+        for ( Project project:allProjects )
         {
-            Project project = (Project) i.next();
-
             if ( project.getProjectGroup().getId() == projectGroupId )
             {
                 groupProjects.add( project );
@@ -1123,17 +1121,17 @@
         return groupProjects;
     }
 
-    public List getAllProjectsByNameWithDependencies()
+    public List<Project> getAllProjectsByNameWithDependencies()
     {
         return getAllObjectsDetached( Project.class, "name ascending", PROJECT_DEPENDENCIES_FETCH_GROUP
);
     }
 
-    public List getAllProjectsByNameWithBuildDetails()
+    public List<Project> getAllProjectsByNameWithBuildDetails()
     {
         return getAllObjectsDetached( Project.class, "name ascending", PROJECT_BUILD_DETAILS_FETCH_GROUP
);
     }
 
-    public List getAllSchedulesByName()
+    public List<Schedule> getAllSchedulesByName()
     {
         return getAllObjectsDetached( Schedule.class, "name ascending", null );
     }
@@ -1197,7 +1195,7 @@
     // Profile
     // ----------------------------------------------------------------    
 
-    public List getAllProfilesByName()
+    public List<Profile> getAllProfilesByName()
     {
         return getAllObjectsDetached( Profile.class, "name ascending", null );
     }
@@ -1258,7 +1256,7 @@
         return (Installation) addObject( installation );
     }
 
-    public List getAllInstallations()
+    public List<Installation> getAllInstallations()
     {
         return getAllObjectsDetached( Installation.class, "name ascending", null );
     }
@@ -1343,7 +1341,7 @@
                 for ( Iterator<Profile> iterator = result.iterator(); iterator.hasNext();
)
                 {
                     Profile profile = iterator.next();
-                    List newEnvironmentVariables = new ArrayList<Installation>();
+                    List<Installation> newEnvironmentVariables = new ArrayList<Installation>();
                     for ( Iterator<Installation> iteInstallation = profile.getEnvironmentVariables().iterator();
                           iteInstallation
                               .hasNext(); )
@@ -1418,7 +1416,7 @@
         }
     }
 
-    public List getAllBuildsForAProjectByDate( int projectId )
+    public List<BuildResult> getAllBuildsForAProjectByDate( int projectId )
     {
         PersistenceManager pm = getPersistenceManager();
 
@@ -1501,7 +1499,7 @@
         return (BuildResult) getObjectById( BuildResult.class, buildId, BUILD_RESULT_WITH_DETAILS_FETCH_GROUP
);
     }
 
-    public List getBuildResultByBuildNumber( int projectId, int buildNumber )
+    public List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber
)
     {
         PersistenceManager pm = getPersistenceManager();
 
@@ -1533,7 +1531,7 @@
         }
     }
 
-    public List getBuildResultsForProject( int projectId, long fromDate )
+    public List<BuildResult> getBuildResultsForProject( int projectId, long fromDate
)
     {
         PersistenceManager pm = getPersistenceManager();
 
@@ -1567,17 +1565,16 @@
         }
     }
 
-    public List getBuildResultsInSuccessForProject( int projectId, long fromDate )
+    public List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long
fromDate )
     {
-        List buildResults = getBuildResultsForProject( projectId, fromDate );
+        List<BuildResult> buildResults = getBuildResultsForProject( projectId, fromDate
);
 
-        List results = new ArrayList();
+        List<BuildResult> results = new ArrayList<BuildResult>();
 
         if ( buildResults != null )
         {
-            for ( Iterator i = buildResults.iterator(); i.hasNext(); )
+            for ( BuildResult res : buildResults )
             {
-                BuildResult res = (BuildResult) i.next();
                 if ( res.getState() == ContinuumProjectState.OK )
                 {
                     results.add( res );
@@ -1683,13 +1680,13 @@
         }
     }
 
-    public List getProjectsInGroup( int projectGroupId )
+    public List<Project> getProjectsInGroup( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return getProjectGroupWithProjects( projectGroupId ).getProjects();
     }
 
-    public List getProjectsInGroupWithDependencies( int projectGroupId )
+    public List<Project> getProjectsInGroupWithDependencies( int projectGroupId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         PersistenceManager pm = getPersistenceManager();
@@ -1736,12 +1733,12 @@
         return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId, PROJECT_BUILD_DETAILS_FETCH_GROUP
);
     }
 
-    public List getAllProjectGroupsWithBuildDetails()
+    public List<ProjectGroup> getAllProjectGroupsWithBuildDetails()
     {
         return getAllObjectsDetached( ProjectGroup.class, "name ascending", PROJECT_BUILD_DETAILS_FETCH_GROUP
);
     }
 
-    public List getAllProjectsWithAllDetails()
+    public List<Project> getAllProjectsWithAllDetails()
     {
         return getAllObjectsDetached( Project.class, "name ascending", PROJECT_ALL_DETAILS_FETCH_GROUP
);
     }
@@ -1906,7 +1903,7 @@
         closePersistenceManagerFactory( continuumPmf, 1 );
     }
 
-    public Collection getAllProjectGroupsWithTheLot()
+    public Collection<ProjectGroup> getAllProjectGroupsWithTheLot()
     {
         List fetchGroups = Arrays.asList( new String[]{PROJECT_WITH_BUILDS_FETCH_GROUP,
             PROJECTGROUP_PROJECTS_FETCH_GROUP, BUILD_RESULT_WITH_DETAILS_FETCH_GROUP,



Mime
View raw message