continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r684085 [2/6] - in /continuum/trunk: ./ continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-base/continuum-configuration/ continuum-commons/ continuum-commons/src/mai...
Date Fri, 08 Aug 2008 20:48:17 GMT
Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,10 @@
 package org.apache.maven.continuum.builddefinition;
 
 import org.apache.continuum.configuration.ContinuumConfigurationException;
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildDefinitionTemplateDao;
+import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -28,7 +32,6 @@
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -49,7 +52,6 @@
     extends AbstractLogEnabled
     implements BuildDefinitionService, Initializable
 {
-
     /**
      * @plexus.configuration default-value=""
      */
@@ -80,11 +82,25 @@
      */
     private String defaultM2Arguments;
 
+    /**
+     * @plexus.requirement
+     */
+    private BuildDefinitionDao buildDefinitionDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private BuildDefinitionTemplateDao buildDefinitionTemplateDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ProjectDao projectDao;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     /**
      * @plexus.requirement role-hint="default"
@@ -122,7 +138,7 @@
     {
         try
         {
-            return store.getBuildDefinition( buildDefinitionId );
+            return buildDefinitionDao.getBuildDefinition( buildDefinitionId );
         }
         catch ( ContinuumObjectNotFoundException e )
         {
@@ -139,7 +155,7 @@
     {
         try
         {
-            return store.addBuildDefinition( buildDefinition );
+            return buildDefinitionDao.addBuildDefinition( buildDefinition );
         }
         catch ( ContinuumStoreException e )
         {
@@ -153,7 +169,7 @@
     {
         try
         {
-            store.removeBuildDefinition( buildDefinition );
+            buildDefinitionDao.removeBuildDefinition( buildDefinition );
         }
         catch ( ContinuumStoreException e )
         {
@@ -166,7 +182,7 @@
     {
         try
         {
-            BuildDefinition storedBuildDefinition = store.getBuildDefinition( buildDefinition.getId() );
+            BuildDefinition storedBuildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinition.getId() );
             storedBuildDefinition.setBuildFresh( buildDefinition.isBuildFresh() );
             storedBuildDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() );
             storedBuildDefinition.setArguments( buildDefinition.getArguments() );
@@ -177,7 +193,7 @@
             storedBuildDefinition.setProfile( buildDefinition.getProfile() );
             storedBuildDefinition.setSchedule( buildDefinition.getSchedule() );
             storedBuildDefinition.setType( buildDefinition.getType() );
-            store.storeBuildDefinition( storedBuildDefinition );
+            buildDefinitionDao.storeBuildDefinition( storedBuildDefinition );
         }
         catch ( ContinuumStoreException e )
         {
@@ -191,7 +207,7 @@
     {
         try
         {
-            return store.getAllBuildDefinitions();
+            return buildDefinitionDao.getAllBuildDefinitions();
         }
         catch ( ContinuumStoreException e )
         {
@@ -205,7 +221,7 @@
     {
         try
         {
-            return store.getAllTemplates();
+            return buildDefinitionDao.getAllTemplates();
         }
         catch ( ContinuumStoreException e )
         {
@@ -239,7 +255,7 @@
     {
         try
         {
-            return store.getContinuumBuildDefinitionTemplateWithType( type );
+            return buildDefinitionTemplateDao.getContinuumBuildDefinitionTemplateWithType( type );
         }
         catch ( ContinuumStoreException e )
         {
@@ -423,7 +439,7 @@
     {
         try
         {
-            return store.getAllBuildDefinitionTemplate();
+            return buildDefinitionTemplateDao.getAllBuildDefinitionTemplate();
         }
         catch ( ContinuumStoreException e )
         {
@@ -436,7 +452,7 @@
     {
         try
         {
-            return store.getBuildDefinitionTemplate( id );
+            return buildDefinitionTemplateDao.getBuildDefinitionTemplate( id );
         }
         catch ( ContinuumStoreException e )
         {
@@ -452,8 +468,9 @@
             // first remove links to buildDefs
             // TODO in the same db transaction ?
             buildDefinitionTemplate.setBuildDefinitions( null );
-            buildDefinitionTemplate = store.updateBuildDefinitionTemplate( buildDefinitionTemplate );
-            store.removeBuildDefinitionTemplate( buildDefinitionTemplate );
+            buildDefinitionTemplate =
+                buildDefinitionTemplateDao.updateBuildDefinitionTemplate( buildDefinitionTemplate );
+            buildDefinitionTemplateDao.removeBuildDefinitionTemplate( buildDefinitionTemplate );
         }
         catch ( ContinuumStoreException e )
         {
@@ -469,7 +486,7 @@
             BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
             stored.setName( buildDefinitionTemplate.getName() );
             stored.setBuildDefinitions( buildDefinitionTemplate.getBuildDefinitions() );
-            return store.updateBuildDefinitionTemplate( stored );
+            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -482,7 +499,7 @@
     {
         try
         {
-            return store.addBuildDefinitionTemplate( buildDefinitionTemplate );
+            return buildDefinitionTemplateDao.addBuildDefinitionTemplate( buildDefinitionTemplate );
         }
         catch ( ContinuumStoreException e )
         {
@@ -506,7 +523,7 @@
             buildDefinition.setTemplate( template );
             //stored.addBuildDefinition( addBuildDefinition( buildDefinition ) );
             stored.addBuildDefinition( buildDefinition );
-            return store.updateBuildDefinitionTemplate( stored );
+            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -532,7 +549,7 @@
                 }
             }
             stored.setBuildDefinitions( buildDefinitions );
-            return store.updateBuildDefinitionTemplate( stored );
+            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -551,17 +568,17 @@
             {
                 return;
             }
-            project = store.getProjectWithBuildDetails( project.getId() );
+            project = projectDao.getProjectWithBuildDetails( project.getId() );
             List<BuildDefinition> buildDefs = new ArrayList<BuildDefinition>();
             for ( Iterator<BuildDefinition> iterator = template.getBuildDefinitions().iterator(); iterator.hasNext(); )
             {
                 BuildDefinition bd = iterator.next();
                 bd = cloneBuildDefinition( bd );
                 bd.setTemplate( false );
-                bd = store.addBuildDefinition( bd );
+                bd = buildDefinitionDao.addBuildDefinition( bd );
                 project.addBuildDefinition( bd );
             }
-            store.updateProject( project );
+            projectDao.updateProject( project );
 
         }
         catch ( ContinuumStoreException e )
@@ -575,7 +592,8 @@
     {
         try
         {
-            ProjectGroup projectGroup = store.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+            ProjectGroup projectGroup =
+                projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
             if ( template.getBuildDefinitions().isEmpty() )
             {
                 return null;
@@ -584,10 +602,10 @@
             for ( Iterator<BuildDefinition> iterator = template.getBuildDefinitions().iterator(); iterator.hasNext(); )
             {
                 BuildDefinition bd = iterator.next();
-                bd = store.addBuildDefinition( cloneBuildDefinition( bd ) );
+                bd = buildDefinitionDao.addBuildDefinition( cloneBuildDefinition( bd ) );
                 projectGroup.addBuildDefinition( bd );
             }
-            store.updateProjectGroup( projectGroup );
+            projectGroupDao.updateProjectGroup( projectGroup );
             return projectGroup;
 
         }
@@ -602,7 +620,7 @@
     {
         try
         {
-            return store.getBuildDefinitionTemplatesWithType( type );
+            return buildDefinitionTemplateDao.getBuildDefinitionTemplatesWithType( type );
         }
         catch ( ContinuumStoreException e )
         {
@@ -615,7 +633,7 @@
     {
         try
         {
-            return store.getContinuumBuildDefinitionTemplates();
+            return buildDefinitionTemplateDao.getContinuumBuildDefinitionTemplates();
         }
         catch ( ContinuumStoreException e )
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java Fri Aug  8 13:48:14 2008
@@ -19,8 +19,8 @@
  * under the License.
  */
 
-import java.util.List;
-
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.ScheduleDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -28,9 +28,10 @@
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
+import java.util.List;
+
 /**
  * AbstractBuildDefinitionContinuumAction:
  *
@@ -41,9 +42,14 @@
     extends AbstractContinuumAction
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildDefinitionDao buildDefinitionDao;
+
+    /**
+     * @plexus.requirement
      */
-    protected ContinuumStore store;
+    private ScheduleDao scheduleDao;
 
     protected void resolveDefaultBuildDefinitionsForProject( BuildDefinition buildDefinition, Project project )
         throws ContinuumException
@@ -53,13 +59,14 @@
             // if buildDefinition passed in is not default then we are done
             if ( buildDefinition.isDefaultForProject() )
             {
-                BuildDefinition storedDefinition = store.getDefaultBuildDefinitionForProject( project.getId() );
+                BuildDefinition storedDefinition =
+                    buildDefinitionDao.getDefaultBuildDefinitionForProject( project.getId() );
 
                 if ( storedDefinition != null )
                 {
                     storedDefinition.setDefaultForProject( false );
 
-                    store.storeBuildDefinition( storedDefinition );
+                    buildDefinitionDao.storeBuildDefinition( storedDefinition );
                 }
             }
         }
@@ -93,7 +100,7 @@
         try
         {
             List<BuildDefinition> storedDefinitions =
-                store.getDefaultBuildDefinitionsForProjectGroup( projectGroup.getId() );
+                buildDefinitionDao.getDefaultBuildDefinitionsForProjectGroup( projectGroup.getId() );
 
             for ( BuildDefinition storedDefinition : storedDefinitions )
             {
@@ -106,10 +113,10 @@
                             buildDefinition.getType().equals( storedDefinition.getType() ) )
                         {
                             //Required to get build def from store because storedDefinition is readonly
-                            BuildDefinition def = store.getBuildDefinition( storedDefinition.getId() );
+                            BuildDefinition def = buildDefinitionDao.getBuildDefinition( storedDefinition.getId() );
                             def.setDefaultForProject( false );
 
-                            store.storeBuildDefinition( def );
+                            buildDefinitionDao.storeBuildDefinition( def );
                         }
                     }
                 }
@@ -141,7 +148,8 @@
      * @param buildDefinition
      * @throws ContinuumException
      */
-    protected BuildDefinition updateBuildDefinitionInList( List<BuildDefinition> buildDefinitions, BuildDefinition buildDefinition )
+    protected BuildDefinition updateBuildDefinitionInList( List<BuildDefinition> buildDefinitions,
+                                                           BuildDefinition buildDefinition )
         throws ContinuumException
     {
         try
@@ -171,7 +179,7 @@
                 {
                     try
                     {
-                        schedule = store.getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
+                        schedule = scheduleDao.getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
                     }
                     catch ( ContinuumStoreException e )
                     {
@@ -180,7 +188,7 @@
                 }
                 else
                 {
-                    schedule = store.getSchedule( buildDefinition.getSchedule().getId() );
+                    schedule = scheduleDao.getSchedule( buildDefinition.getSchedule().getId() );
                 }
 
                 storedDefinition.setSchedule( schedule );
@@ -193,7 +201,7 @@
 
                 storedDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() );
 
-                store.storeBuildDefinition( storedDefinition );
+                buildDefinitionDao.storeBuildDefinition( storedDefinition );
 
                 return storedDefinition;
             }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java Fri Aug  8 13:48:14 2008
@@ -19,9 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
@@ -39,9 +39,9 @@
     extends AbstractContinuumAction
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     /**
      * @plexus.requirement role-hint="default"
@@ -53,7 +53,7 @@
     {
         int projectGroupId = getProjectGroupId( context );
 
-        ProjectGroup projectGroup = store.getProjectGroup( projectGroupId );
+        ProjectGroup projectGroup = projectGroupDao.getProjectGroup( projectGroupId );
 
         // TODO: make the resource the name of the project group and hide the id from the user
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java Fri Aug  8 13:48:14 2008
@@ -15,6 +15,7 @@
  * the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
 import org.apache.maven.continuum.model.project.Project;
@@ -33,11 +34,16 @@
 public class AddBuildDefinitionToProjectAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectDao projectDao;
+
     public void execute( Map map )
         throws Exception
     {
         int projectId = getProjectId( map );
-        Project project = store.getProjectWithAllDetails( projectId );
+        Project project = projectDao.getProjectWithAllDetails( projectId );
 
         BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
 
@@ -51,7 +57,7 @@
 
                 project.addBuildDefinition( buildDefinition );
 
-                store.updateProject( project );
+                projectDao.updateProject( project );
                 if ( buildDefinition.isDefaultForProject() )
                 {
                     map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
@@ -65,7 +71,7 @@
 
             project.addBuildDefinition( buildDefinition );
 
-            store.updateProject( project );
+            projectDao.updateProject( project );
             map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
         }
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -37,12 +38,17 @@
 public class AddBuildDefinitionToProjectGroupAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectGroupDao projectGroupDao;
+
 
     public void execute( Map map )
         throws Exception
     {
         int projectGroupId = getProjectGroupId( map );
-        ProjectGroup projectGroup = store.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+        ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
         BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
         if ( buildDefinitionTemplate != null )
         {
@@ -54,7 +60,7 @@
 
                 projectGroup.addBuildDefinition( buildDefinition );
 
-                store.updateProjectGroup( projectGroup );
+                projectGroupDao.updateProjectGroup( projectGroup );
             }
         }
         else
@@ -65,7 +71,7 @@
 
             projectGroup.addBuildDefinition( buildDefinition );
 
-            store.updateProjectGroup( projectGroup );
+            projectGroupDao.updateProjectGroup( projectGroup );
         }
         //map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java Fri Aug  8 13:48:14 2008
@@ -19,14 +19,14 @@
  * under the License.
  */
 
-import java.util.Map;
-
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.scm.queue.CheckOutTask;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -47,19 +47,19 @@
     private TaskQueue checkOutQueue;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
-    
+    private ProjectDao projectDao;
+
     @SuppressWarnings("unchecked")
     public void execute( Map context )
         throws Exception
     {
-        
+
         Project project = (Project) getObject( context, KEY_PROJECT, null );
-        if (project == null)
+        if ( project == null )
         {
-            project = store.getProject( getProjectId( context ) );
+            project = projectDao.getProject( getProjectId( context ) );
         }
 
         CheckOutTask checkOutTask = new CheckOutTask( project.getId(), workingDirectoryService

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java Fri Aug  8 13:48:14 2008
@@ -19,8 +19,8 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
 import java.io.File;
@@ -41,14 +41,14 @@
     private WorkingDirectoryService workingDirectoryService;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws Exception
     {
-        Project project = store.getProject( getProjectId( context ) );
+        Project project = projectDao.getProject( getProjectId( context ) );
 
         File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java Fri Aug  8 13:48:14 2008
@@ -19,11 +19,8 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.scm.ContinuumScm;
 import org.apache.continuum.scm.ContinuumScmConfiguration;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -32,7 +29,6 @@
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.scm.ScmException;
@@ -41,6 +37,11 @@
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -60,25 +61,30 @@
     private ContinuumScm scm;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildDefinitionDao buildDefinitionDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
-        Project project = store.getProject( getProject( context ).getId() );
+        Project project = projectDao.getProject( getProject( context ).getId() );
 
         BuildDefinition buildDefinition = getBuildDefinition( context );
 
         if ( buildDefinition != null )
         {
-            buildDefinition = store.getBuildDefinition( buildDefinition.getId() );
+            buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinition.getId() );
         }
 
         project.setState( ContinuumProjectState.CHECKING_OUT );
 
-        store.updateProject( project );
+        projectDao.updateProject( project );
 
         File workingDirectory = getWorkingDirectory( context );
 
@@ -92,13 +98,12 @@
         {
             String scmUserName = getString( context, KEY_SCM_USERNAME, "" );
             String scmPassword = getString( context, KEY_SCM_PASSWORD, "" );
-            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
+            ContinuumScmConfiguration config =
+                createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
 
             String tag = config.getTag();
-            getLogger().info(
-                              "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' "
-                                  + "to '" + workingDirectory + "'"
-                                  + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
+            getLogger().info( "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' " +
+                "to '" + workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
 
             CheckOutScmResult checkoutResult = scm.checkout( config );
             if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
@@ -111,10 +116,9 @@
             {
                 // TODO: is it more appropriate to return this in the converted result so that it can be presented to
                 // the user?
-                String msg =
-                    "Error while checking out the code for project: '" + project.getName() + "', id: '"
-                        + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'"
-                        + ( tag != null ? " with branch/tag " + tag + "." : "." );
+                String msg = "Error while checking out the code for project: '" + project.getName() + "', id: '" +
+                    project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" +
+                    ( tag != null ? " with branch/tag " + tag + "." : "." );
                 getLogger().warn( msg );
 
                 getLogger().warn( "Command output: " + checkoutResult.getCommandOutput() );
@@ -135,8 +139,8 @@
             result.setSuccess( false );
 
             result.setProviderMessage( e.getMessage() + ": " + getValidationMessages( e ) );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         catch ( NoSuchScmProviderException e )
         {
@@ -146,8 +150,8 @@
             result.setSuccess( false );
 
             result.setProviderMessage( e.getMessage() );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         catch ( ScmException e )
         {
@@ -156,8 +160,8 @@
             result.setSuccess( false );
 
             result.setException( ContinuumUtils.throwableMessagesToString( e ) );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         catch ( Throwable t )
         {
@@ -168,8 +172,8 @@
             result.setSuccess( false );
 
             result.setException( ContinuumUtils.throwableMessagesToString( t ) );
-            
-            getLogger().error( t.getMessage(), t);
+
+            getLogger().error( t.getMessage(), t );
         }
         finally
         {
@@ -179,11 +183,11 @@
                 project.setRelativePath( relativePath );
             }
 
-            project = store.getProject( project.getId() );
+            project = projectDao.getProject( project.getId() );
 
             project.setState( ContinuumProjectState.CHECKEDOUT );
 
-            store.updateProject( project );
+            projectDao.updateProject( project );
 
             notifier.checkoutComplete( project, buildDefinition );
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java Fri Aug  8 13:48:14 2008
@@ -19,12 +19,11 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.shared.model.fileset.FileSet;
 import org.apache.maven.shared.model.fileset.util.FileSetManager;
-import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
 import java.util.Map;
@@ -44,14 +43,14 @@
     private WorkingDirectoryService workingDirectoryService;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws Exception
     {
-        Project project = store.getProject( getProjectId( context ) );
+        Project project = projectDao.getProject( getProjectId( context ) );
 
         File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -29,7 +31,6 @@
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.ContinuumUtils;
 
 import java.io.File;
@@ -57,9 +58,14 @@
     private BuildExecutorManager buildExecutorManager;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildResultDao buildResultDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     /**
      * @plexus.requirement
@@ -73,7 +79,7 @@
         // Get parameters from the context
         // ----------------------------------------------------------------------
 
-        Project project = store.getProject( getProject( context ).getId() );
+        Project project = projectDao.getProject( getProject( context ).getId() );
 
         BuildDefinition buildDefinition = getBuildDefinition( context );
 
@@ -103,11 +109,11 @@
 
         buildResult.setBuildDefinition( getBuildDefinition( context ) );
 
-        store.addBuildResult( project, buildResult );
+        buildResultDao.addBuildResult( project, buildResult );
 
         context.put( KEY_BUILD_ID, Integer.toString( buildResult.getId() ) );
 
-        buildResult = store.getBuildResult( buildResult.getId() );
+        buildResult = buildResultDao.getBuildResult( buildResult.getId() );
 
         try
         {
@@ -133,7 +139,7 @@
         {
             buildResult.setEndTime( new Date().getTime() );
 
-            project = store.getProject( project.getId() );
+            project = projectDao.getProject( project.getId() );
 
             if ( buildResult.getState() == ContinuumProjectState.OK )
             {
@@ -157,13 +163,13 @@
             // Copy over the buildResult result
             // ----------------------------------------------------------------------
 
-            store.updateBuildResult( buildResult );
+            buildResultDao.updateBuildResult( buildResult );
 
-            buildResult = store.getBuildResult( buildResult.getId() );
+            buildResult = buildResultDao.getBuildResult( buildResult.getId() );
 
             context.put( KEY_PROJECT, project );
-            
-            store.updateProject( project );
+
+            projectDao.updateProject( project );
 
             notifier.goalsCompleted( project, buildDefinition, buildResult );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java Fri Aug  8 13:48:14 2008
@@ -19,9 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
@@ -39,9 +39,9 @@
     extends AbstractContinuumAction
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     /**
      * @plexus.requirement role-hint="default"
@@ -53,7 +53,7 @@
     {
         int projectGroupId = getProjectGroupId( context );
 
-        ProjectGroup projectGroup = store.getProjectGroup( projectGroupId );
+        ProjectGroup projectGroup = projectGroupDao.getProjectGroup( projectGroupId );
 
         try
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 
@@ -35,6 +36,10 @@
 public class RemoveBuildDefinitionFromProjectAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectDao projectDao;
 
     public void execute( Map map )
         throws Exception
@@ -42,13 +47,13 @@
         BuildDefinition buildDefinition = getBuildDefinition( map );
         int projectId = getProjectId( map );
 
-        Project project = store.getProjectWithAllDetails( projectId );
+        Project project = projectDao.getProjectWithAllDetails( projectId );
 
         // removing build definition from project doesn't effect anything if it is the default for the proejct, the
         // default will just change automatically to the default build definition of the project group.
 
         project.removeBuildDefinition( buildDefinition );
 
-        store.updateProject( project );
+        projectDao.updateProject( project );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -36,6 +37,11 @@
 public class RemoveBuildDefinitionFromProjectGroupAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectGroupDao projectGroupDao;
+
 
     public void execute( Map map )
         throws Exception
@@ -43,7 +49,7 @@
         BuildDefinition buildDefinition = getBuildDefinition( map );
         int projectGroupId = getProjectGroupId( map );
 
-        ProjectGroup projectGroup = store.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+        ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
         if ( buildDefinition.isDefaultForProject() )
         {
@@ -52,6 +58,6 @@
 
         projectGroup.removeBuildDefinition( buildDefinition );
 
-        store.updateProjectGroup( projectGroup );
+        projectGroupDao.updateProjectGroup( projectGroup );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java Fri Aug  8 13:48:14 2008
@@ -19,9 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ScmResult;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
@@ -37,9 +37,9 @@
     extends AbstractContinuumAction
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws TaskExecutionException
@@ -52,11 +52,11 @@
 
             ScmResult scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
 
-            Project project = store.getProject( getProjectId( context ) );
+            Project project = projectDao.getProject( getProjectId( context ) );
 
             project.setCheckoutResult( scmResult );
 
-            store.updateProject( project );
+            projectDao.updateProject( project );
         }
         catch ( ContinuumStoreException e )
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java Fri Aug  8 13:48:14 2008
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import java.util.Map;
@@ -36,11 +36,10 @@
 public class StoreProjectAction
     extends AbstractContinuumAction
 {
-
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     public void execute( Map context )
         throws ContinuumException, ContinuumStoreException
@@ -61,10 +60,10 @@
             project.setScmPassword( null );
             project.setScmUseCache( false );
         }
-        
+
         projectGroup.addProject( project );
 
-        store.updateProjectGroup( projectGroup );
+        projectGroupDao.updateProjectGroup( projectGroup );
 
         context.put( KEY_PROJECT_ID, new Integer( project.getId() ) );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java Fri Aug  8 13:48:14 2008
@@ -19,9 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import java.util.Map;
@@ -36,9 +36,9 @@
     extends AbstractContinuumAction
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     public void execute( Map context )
         throws ContinuumException, ContinuumStoreException
@@ -49,7 +49,7 @@
         //
         // ----------------------------------------------------------------------
 
-        projectGroup = store.addProjectGroup( projectGroup );
+        projectGroup = projectGroupDao.addProjectGroup( projectGroup );
 
         context.put( KEY_PROJECT_GROUP_ID, new Integer( projectGroup.getId() ) );
     }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 
@@ -35,6 +36,10 @@
 public class UpdateBuildDefinitionFromProjectAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectDao projectDao;
 
     public void execute( Map map )
         throws Exception
@@ -42,7 +47,7 @@
         BuildDefinition buildDefinition = getBuildDefinition( map );
         int projectId = getProjectId( map );
 
-        Project project = store.getProjectWithAllDetails( projectId );
+        Project project = projectDao.getProjectWithAllDetails( projectId );
 
         resolveDefaultBuildDefinitionsForProject( buildDefinition, project );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 
@@ -35,6 +36,10 @@
 public class UpdateBuildDefinitionFromProjectGroupAction
     extends AbstractBuildDefinitionContinuumAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private ProjectGroupDao projectGroupDao;
 
     public void execute( Map map )
         throws Exception
@@ -42,7 +47,7 @@
         BuildDefinition buildDefinition = getBuildDefinition( map );
         int projectGroupId = getProjectGroupId( map );
 
-        ProjectGroup projectGroup = store.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+        ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
         resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java Fri Aug  8 13:48:14 2008
@@ -19,13 +19,14 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
@@ -51,20 +52,25 @@
     private BuildExecutorManager buildExecutorManager;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildDefinitionDao buildDefinitionDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws ContinuumStoreException, ContinuumException, ContinuumBuildExecutorException
     {
         Project project = getProject( context );
 
-        project = store.getProjectWithAllDetails( project.getId() );
+        project = projectDao.getProjectWithAllDetails( project.getId() );
 
         getLogger().info( "Updating project '" + project.getName() + "' from checkout." );
 
-        BuildDefinition buildDefinition = store.getBuildDefinition( getBuildDefinitionId( context ) );
+        BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( getBuildDefinitionId( context ) );
 
         // ----------------------------------------------------------------------
         // Make a new descriptor
@@ -79,6 +85,6 @@
         // Store the new descriptor
         // ----------------------------------------------------------------------
 
-        store.updateProject( project );
+        projectDao.updateProject( project );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.scm.ContinuumScm;
 import org.apache.continuum.scm.ContinuumScmConfiguration;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -30,7 +32,6 @@
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.scm.ScmException;
@@ -41,7 +42,6 @@
 
 import java.io.File;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -69,15 +69,20 @@
     private WorkingDirectoryService workingDirectoryService;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildResultDao buildResultDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws ScmRepositoryException, NoSuchScmProviderException, ScmException, ContinuumObjectNotFoundException,
         ContinuumStoreException
     {
-        Project project = store.getProject( getProject( context ).getId() );
+        Project project = projectDao.getProject( getProject( context ).getId() );
 
         BuildDefinition buildDefinition = getBuildDefinition( context );
 
@@ -85,14 +90,14 @@
 
         project.setState( ContinuumProjectState.UPDATING );
 
-        store.updateProject( project );
+        projectDao.updateProject( project );
 
         UpdateScmResult scmResult;
 
         Date latestUpdateDate = null;
         try
         {
-            BuildResult result = store.getLatestBuildResultForProject( project.getId() );
+            BuildResult result = buildResultDao.getLatestBuildResultForProject( project.getId() );
 
             latestUpdateDate = new Date( result.getStartTime() );
         }
@@ -109,9 +114,8 @@
             ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
             config.setLatestUpdateDate( latestUpdateDate );
             String tag = config.getTag();
-            String msg =
-                project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'"
-                    + ( tag != null ? " with branch/tag " + tag + "." : "." );
+            String msg = project.getName() + "', id: '" + project.getId() + "' to '" +
+                workingDirectory.getAbsolutePath() + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." );
             getLogger().info( "Updating project: " + msg );
             scmResult = scm.update( config );
 
@@ -137,11 +141,11 @@
             // TODO: transient states!
             try
             {
-                project = store.getProject( project.getId() );
+                project = projectDao.getProject( project.getId() );
 
                 project.setState( state );
 
-                store.updateProject( project );
+                projectDao.updateProject( project );
             }
             catch ( Exception e )
             {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java Fri Aug  8 13:48:14 2008
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.List;
@@ -43,9 +43,9 @@
     private BuildExecutorManager buildExecutorManager;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     public void execute( Map context )
         throws Exception
@@ -61,15 +61,15 @@
         {
             throw new ContinuumException( "No such executor with id '" + project.getExecutorId() + "'." );
         }
-        
-        List<Project> projects = store.getAllProjectsByName();
-        
-        for (Project storedProject : projects)
+
+        List<Project> projects = projectDao.getAllProjectsByName();
+
+        for ( Project storedProject : projects )
         {
             // CONTINUUM-1445
-            if ( StringUtils.equalsIgnoreCase( project.getName(), storedProject.getName() )
-                && StringUtils.equalsIgnoreCase( project.getVersion(), storedProject.getVersion() )
-                && StringUtils.equalsIgnoreCase( project.getScmUrl(), storedProject.getScmUrl() ) )
+            if ( StringUtils.equalsIgnoreCase( project.getName(), storedProject.getName() ) &&
+                StringUtils.equalsIgnoreCase( project.getVersion(), storedProject.getVersion() ) &&
+                StringUtils.equalsIgnoreCase( project.getScmUrl(), storedProject.getScmUrl() ) )
             {
                 throw new ContinuumException( "A duplicate project already exist '" + storedProject.getName() + "'." );
             }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java Fri Aug  8 13:48:14 2008
@@ -19,8 +19,10 @@
  * under the License.
  */
 
-import java.io.IOException;
-
+import org.apache.continuum.dao.LocalRepositoryDao;
+import org.apache.continuum.dao.ProjectGroupDao;
+import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
+import org.apache.continuum.dao.SystemConfigurationDao;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
 import org.apache.maven.continuum.Continuum;
@@ -29,7 +31,6 @@
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.settings.MavenSettingsBuilder;
 import org.apache.maven.settings.Settings;
@@ -37,6 +38,8 @@
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.jpox.SchemaTool;
 
+import java.io.IOException;
+
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -53,9 +56,24 @@
     // ----------------------------------------------------------------------
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private LocalRepositoryDao localRepositoryDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private RepositoryPurgeConfigurationDao repositoryPurgeConfigurationDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ProjectGroupDao projectGroupDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private SystemConfigurationDao systemConfigurationDao;
 
     /**
      * @plexus.requirement
@@ -66,7 +84,7 @@
      * @plexus.requirement
      */
     private MavenSettingsBuilder mavenSettingsBuilder;
-    
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -93,17 +111,17 @@
         try
         {
             // System Configuration
-            SystemConfiguration systemConf = store.getSystemConfiguration();
+            SystemConfiguration systemConf = systemConfigurationDao.getSystemConfiguration();
 
             if ( systemConf == null )
             {
                 systemConf = new SystemConfiguration();
 
-                systemConf = store.addSystemConfiguration( systemConf );
+                systemConf = systemConfigurationDao.addSystemConfiguration( systemConf );
             }
 
             createDefaultLocalRepository();
-            
+
             createDefaultProjectGroup();
         }
         catch ( ContinuumStoreException e )
@@ -124,7 +142,7 @@
         ProjectGroup group;
         try
         {
-            group = store.getProjectGroupByGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID );
+            group = projectGroupDao.getProjectGroupByGroupId( Continuum.DEFAULT_PROJECT_GROUP_GROUP_ID );
             getLogger().info( "Default Project Group exists" );
         }
         catch ( ContinuumObjectNotFoundException e )
@@ -140,62 +158,62 @@
 
             group.setDescription( "Contains all projects that do not have a group of their own" );
 
-            LocalRepository localRepository = store.getLocalRepositoryByName( "DEFAULT" );
-            
+            LocalRepository localRepository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );
+
             group.setLocalRepository( localRepository );
-            
+
             group.getBuildDefinitions().addAll(
                 buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate().getBuildDefinitions() );
 
-            group = store.addProjectGroup( group );
+            group = projectGroupDao.addProjectGroup( group );
         }
     }
-    
+
     private void createDefaultLocalRepository()
         throws ContinuumStoreException, ContinuumInitializationException
     {
         LocalRepository repository;
-        
-        repository = store.getLocalRepositoryByName( "DEFAULT" );
-        
+
+        repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );
+
         Settings settings = getSettings();
-        
+
         if ( repository == null )
         {
             getLogger().info( "create Default Local Repository" );
-            
+
             repository = new LocalRepository();
-            
+
             repository.setName( "DEFAULT" );
-            
+
             repository.setLocation( settings.getLocalRepository() );
-            
-            repository = store.addLocalRepository( repository );
-            
+
+            repository = localRepositoryDao.addLocalRepository( repository );
+
             createDefaultPurgeConfiguration( repository );
         }
         else if ( !repository.getLocation().equals( settings.getLocalRepository() ) )
         {
             getLogger().info( "updating location of Default Local Repository" );
-            
+
             repository.setLocation( settings.getLocalRepository() );
-            
-            store.updateLocalRepository( repository );
+
+            localRepositoryDao.updateLocalRepository( repository );
         }
     }
-    
+
     private void createDefaultPurgeConfiguration( LocalRepository repository )
         throws ContinuumStoreException
     {
         RepositoryPurgeConfiguration repoPurge = new RepositoryPurgeConfiguration();
-        
+
         repoPurge.setRepository( repository );
-        
+
         repoPurge.setDefaultPurge( true );
-        
-        store.addRepositoryPurgeConfiguration( repoPurge );
+
+        repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
     }
-    
+
     private Settings getSettings()
         throws ContinuumInitializationException
     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java Fri Aug  8 13:48:14 2008
@@ -19,13 +19,13 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.InstallationDao;
 import org.apache.maven.continuum.execution.ExecutorConfigurator;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
 import org.apache.maven.continuum.profile.ProfileException;
 import org.apache.maven.continuum.profile.ProfileService;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -58,9 +58,9 @@
     implements InstallationService, Initializable
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private InstallationDao installationDao;
 
     /**
      * @plexus.requirement role-hint="default"
@@ -111,8 +111,8 @@
     {
         if ( alreadyExistInstallationName( installation ) )
         {
-            throw new AlreadyExistsInstallationException( "Installation with name " + installation.getName()
-                + " already exists" );
+            throw new AlreadyExistsInstallationException(
+                "Installation with name " + installation.getName() + " already exists" );
         }
         // TODO must be done in the same transaction
         Installation storedOne = null;
@@ -124,7 +124,7 @@
             {
                 installation.setVarName( envVarName );
             }
-            storedOne = store.addInstallation( installation );
+            storedOne = installationDao.addInstallation( installation );
         }
         catch ( ContinuumStoreException e )
         {
@@ -155,7 +155,7 @@
     {
         try
         {
-            store.removeInstallation( installation );
+            installationDao.removeInstallation( installation );
         }
         catch ( ContinuumStoreException e )
         {
@@ -173,7 +173,7 @@
     {
         try
         {
-            List installations = store.getAllInstallations();
+            List installations = installationDao.getAllInstallations();
             return installations == null ? Collections.EMPTY_LIST : installations;
         }
         catch ( ContinuumStoreException e )
@@ -190,7 +190,7 @@
     {
         try
         {
-            return store.getInstallation( installationId );
+            return installationDao.getInstallation( installationId );
         }
         catch ( ContinuumStoreException e )
         {
@@ -225,7 +225,7 @@
                 stored.setVarName( installation.getVarName() );
             }
             stored.setVarValue( installation.getVarValue() );
-            store.updateInstallation( stored );
+            installationDao.updateInstallation( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -365,7 +365,7 @@
         }
         if ( profile.getEnvironmentVariables() != null )
         {
-            for ( Installation installation: (List<Installation>)profile.getEnvironmentVariables() )
+            for ( Installation installation : (List<Installation>) profile.getEnvironmentVariables() )
             {
                 environnments.put( installation.getVarName(), installation.getVarValue() );
             }
@@ -441,7 +441,7 @@
             throw new InstallationException( e.getMessage(), e );
         }
     }
-    
+
     private boolean alreadyExistInstallationName( Installation installation )
         throws InstallationException
     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/DefaultContinuumNotificationDispatcher.java Fri Aug  8 13:48:14 2008
@@ -19,13 +19,14 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.notification.manager.NotifierManager;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,9 +53,14 @@
     private NotifierManager notifierManager;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private ProjectDao projectDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectGroupDao projectGroupDao;
 
     // ----------------------------------------------------------------------
     // ContinuumNotificationDispatcher Implementation
@@ -111,10 +117,10 @@
             // Here we need to get all the project details
             //  - builds are used to detect if the state has changed (TODO: maybe previousState field is better)
             //  - notifiers are used to send the notification
-            project = store.getProjectWithAllDetails( project.getId() );
+            project = projectDao.getProjectWithAllDetails( project.getId() );
 
             ProjectGroup projectGroup =
-                store.getProjectGroupWithBuildDetailsByProjectGroupId( project.getProjectGroup().getId() );
+                projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( project.getProjectGroup().getId() );
 
             Map<String, List<ProjectNotifier>> notifiersMap = new HashMap<String, List<ProjectNotifier>>();
             // perform the project level notifications

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java Fri Aug  8 13:48:14 2008
@@ -19,17 +19,17 @@
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.commons.lang.StringUtils;
+import org.apache.continuum.dao.ProfileDao;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author <a href="mailto:olamy@codehaus.org">olamy</a>
  * @version $Id$
@@ -40,11 +40,10 @@
 public class DefaultProfileService
     implements ProfileService
 {
-
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProfileDao profileDao;
 
     /**
      * @see org.apache.maven.continuum.profile.ProfileService#updateProfile(org.apache.maven.continuum.model.system.Profile)
@@ -52,14 +51,14 @@
     public void updateProfile( Profile profile )
         throws ProfileException, AlreadyExistsProfileException
     {
-        
+
         // already exists check should be done in the same transaction
         // but we assume we don't have a huge load and a lot of concurrent access ;-)
         if ( alreadyExistsProfileName( profile ) )
         {
             throw new AlreadyExistsProfileException( "profile with name " + profile.getName() + " already exists" );
-        }        
-        
+        }
+
         try
         {
             Profile stored = getProfile( profile.getId() );
@@ -70,14 +69,14 @@
             stored.setJdk( profile.getJdk() );
             stored.setName( profile.getName() );
             stored.setEnvironmentVariables( profile.getEnvironmentVariables() );
-            store.updateProfile( stored );
+            profileDao.updateProfile( stored );
         }
         catch ( ContinuumStoreException e )
         {
             throw new ProfileException( e.getMessage(), e );
         }
     }
-    
+
     public void updateProfileCheckDuplicateName( Profile profile, boolean checkDuplicateName )
         throws ProfileException, AlreadyExistsProfileException
     {
@@ -100,13 +99,13 @@
             stored.setJdk( profile.getJdk() );
             stored.setName( profile.getName() );
             stored.setEnvironmentVariables( profile.getEnvironmentVariables() );
-            store.updateProfile( stored );
+            profileDao.updateProfile( stored );
         }
         catch ( ContinuumStoreException e )
         {
             throw new ProfileException( e.getMessage(), e );
         }
-    }    
+    }
 
     /**
      * @see org.apache.maven.continuum.profile.ProfileService#addProfile(org.apache.maven.continuum.model.system.Profile)
@@ -123,16 +122,16 @@
         profile.setBuilder( null );
         profile.setJdk( null );
         profile.setEnvironmentVariables( null );
-        return store.addProfile( profile );
+        return profileDao.addProfile( profile );
     }
-    
+
     /**
      * @see org.apache.maven.continuum.profile.ProfileService#deleteProfile(int)
      */
     public void deleteProfile( int profileId )
         throws ProfileException
     {
-        store.removeProfile( getProfile( profileId ) );
+        profileDao.removeProfile( getProfile( profileId ) );
     }
 
     /**
@@ -141,7 +140,7 @@
     public List<Profile> getAllProfiles()
         throws ProfileException
     {
-        return store.getAllProfilesByName();
+        return profileDao.getAllProfilesByName();
     }
 
     /**
@@ -152,7 +151,7 @@
     {
         try
         {
-            return store.getProfile( profileId );
+            return profileDao.getProfile( profileId );
         }
         catch ( ContinuumObjectNotFoundException e )
         {
@@ -175,7 +174,7 @@
         stored.setBuilder( builder );
         try
         {
-            store.updateProfile( stored );
+            profileDao.updateProfile( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -193,7 +192,7 @@
         stored.setJdk( jdk );
         try
         {
-            store.updateProfile( stored );
+            profileDao.updateProfile( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -211,7 +210,7 @@
         stored.addEnvironmentVariable( envVar );
         try
         {
-            store.updateProfile( stored );
+            profileDao.updateProfile( stored );
         }
         catch ( ContinuumStoreException e )
         {
@@ -226,9 +225,9 @@
         {
             setJdkInProfile( profile, installation );
         }
-        else if ( InstallationService.MAVEN1_TYPE.equals( installation.getType() )
-            || InstallationService.MAVEN2_TYPE.equals( installation.getType() )
-            || InstallationService.ANT_TYPE.equals( installation.getType() ) )
+        else if ( InstallationService.MAVEN1_TYPE.equals( installation.getType() ) ||
+            InstallationService.MAVEN2_TYPE.equals( installation.getType() ) ||
+            InstallationService.ANT_TYPE.equals( installation.getType() ) )
         {
             setBuilderInProfile( profile, installation );
         }
@@ -275,7 +274,7 @@
         {
             // normally cannot happend here but anyway we throw the exception
             throw new ProfileException( e.getMessage(), e );
-        }        
+        }
     }
 
 
@@ -302,6 +301,6 @@
         throws ProfileException
     {
         return getProfileWithName( profile.getName() ) != null;
-    }    
-    
+    }
+
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java Fri Aug  8 13:48:14 2008
@@ -19,15 +19,8 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.apache.continuum.dao.LocalRepositoryDao;
+import org.apache.continuum.dao.ScheduleDao;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
@@ -43,11 +36,19 @@
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -64,12 +65,17 @@
     /**
      * @plexus.requirement
      */
+    private LocalRepositoryDao localRepositoryDao;
+
+    /**
+     * @plexus.requirement
+     */
     private MavenBuilderHelper builderHelper;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ScheduleDao scheduleDao;
 
     /**
      * @plexus.requirement
@@ -140,7 +146,7 @@
         MavenProject mavenProject;
 
         File pomFile = null;
-        
+
         try
         {
             pomFile = createMetadataFile( url, username, password );
@@ -223,7 +229,8 @@
                     {
                         try
                         {
-                            Schedule schedule = store.getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
+                            Schedule schedule =
+                                scheduleDao.getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
 
                             buildDefinition.setSchedule( schedule );
                         }
@@ -418,18 +425,18 @@
         // ----------------------------------------------------------------------
         // Local Repository
         // ----------------------------------------------------------------------
-        
+
         try
         {
-            LocalRepository repository = store.getLocalRepositoryByName( "DEFAULT" );
-        
+            LocalRepository repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );
+
             projectGroup.setLocalRepository( repository );
         }
         catch ( ContinuumStoreException e )
         {
             getLogger().warn( "Can't get default repository.", e );
         }
-        
+
         return projectGroup;
     }
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java Fri Aug  8 13:48:14 2008
@@ -19,13 +19,13 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildResultDao;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ChangeFile;
 import org.apache.maven.continuum.model.scm.ChangeSet;
 import org.apache.maven.continuum.model.scm.ScmResult;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFile;
@@ -68,9 +68,9 @@
     private WorkingDirectoryService workingDirectoryService;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private BuildResultDao buildResultDao;
 
     /**
      * @plexus.configuration
@@ -319,7 +319,7 @@
     {
         try
         {
-            BuildResult result = store.getLatestBuildResultForProject( project.getId() );
+            BuildResult result = buildResultDao.getLatestBuildResultForProject( project.getId() );
 
             return new Date( result.getStartTime() );
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Fri Aug  8 13:48:14 2008
@@ -19,9 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -48,9 +48,9 @@
     private ActionManager actionManager;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     // ----------------------------------------------------------------------
     // TaskExecutor Implementation
@@ -67,7 +67,7 @@
 
         try
         {
-            project = store.getProjectWithBuildDetails( projectId );
+            project = projectDao.getProjectWithBuildDetails( projectId );
         }
         catch ( ContinuumStoreException ex )
         {
@@ -85,11 +85,10 @@
         context.put( AbstractContinuumAction.KEY_PROJECT, project );
 
         context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, workingDirectory );
-        
+
         context.put( AbstractContinuumAction.KEY_SCM_USERNAME, task.getScmUserName() );
-        
+
         context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, task.getScmPassword() );
-        
 
         try
         {



Mime
View raw message