org.apache.continuum.builder.distributed.manager
Class DefaultDistributedBuildManager

java.lang.Object
  extended by org.apache.continuum.builder.distributed.manager.DefaultDistributedBuildManager
All Implemented Interfaces:
DistributedBuildManager, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

public class DefaultDistributedBuildManager
extends Object
implements DistributedBuildManager, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

Author:
Maria Catherine Tan

Field Summary
 
Fields inherited from interface org.apache.continuum.builder.distributed.manager.DistributedBuildManager
ROLE
 
Constructor Summary
DefaultDistributedBuildManager()
           
 
Method Summary
 void cancelBuild(int projectId)
           
 void cancelDistributedBuild(String buildAgentUrl)
           
 void cancelGroupBuild(int projectGroupId)
           
 void contextualize(org.codehaus.plexus.context.Context context)
           
 SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection(String buildAgentUrl)
           
 String generateWorkingCopyContent(int projectId, String directory, String baseUrl, String imageBaseUrl)
           
 List<Installation> getAvailableInstallations(String buildAgentUrl)
           
 String getBuildAgentPlatform(String buildAgentUrl)
           
 String getBuildAgentUrl(int projectId, int buildDefinitionId)
           
 Map<String,Object> getBuildResult(int projectId)
           
 List<ProjectRunSummary> getCurrentRuns()
           
 Map<String,Object> getFileContent(int projectId, String directory, String filename)
           
 Map<String,BuildProjectTask> getProjectsCurrentlyBuilding()
           
 Map<String,PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
           
 Map<String,List<BuildProjectTask>> getProjectsInBuildQueue()
           
 Map<String,List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue()
           
 void initialize()
           
 boolean isAgentAvailable(String buildAgentUrl)
           
 boolean isBuildAgentBusy(String buildAgentUrl)
           
 boolean isProjectCurrentlyBuilding(int projectId, int buildDefinitionId)
           
 boolean isProjectCurrentlyPreparingBuild(int projectId, int buildDefinitionId)
           
 boolean isProjectInAnyBuildQueue(int projectId, int buildDefinitionId)
           
 boolean isProjectInAnyPrepareBuildQueue(int projectId, int buildDefinitionId)
           
 boolean pingBuildAgent(String buildAgentUrl)
           
 void prepareBuildProjects(Map<Integer,Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots)
           
 void reload()
           
 void removeCurrentRun(int projectId, int buildDefinitionId)
           
 void removeDistributedBuildQueueOfAgent(String buildAgentUrl)
           
 void removeFromBuildQueue(List<String> hashCodes)
           
 void removeFromBuildQueue(String buildAgentUrl, int projectId, int buildDefinitionId)
           
 void removeFromPrepareBuildQueue(List<String> hashCodes)
           
 void removeFromPrepareBuildQueue(String buildAgentUrl, int projectGroupId, int scmRootId)
           
 void setBuildDefinitionDao(BuildDefinitionDao buildDefinitionDao)
           
 void setBuildResultDao(BuildResultDao buildResultDao)
           
 void setConfigurationService(ConfigurationService configurationService)
           
 void setContainer(org.codehaus.plexus.PlexusContainer container)
           
 void setCurrentRuns(List<ProjectRunSummary> currentRuns)
           
 void setOverallDistributedBuildQueues(Map<String,OverallDistributedBuildQueue> overallDistributedBuildQueues)
           
 void setProjectDao(ProjectDao projectDao)
           
 void setProjectScmRootDao(ProjectScmRootDao projectScmRootDao)
           
 void update(BuildAgentConfiguration agent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDistributedBuildManager

public DefaultDistributedBuildManager()
Method Detail

contextualize

public void contextualize(org.codehaus.plexus.context.Context context)
                   throws org.codehaus.plexus.context.ContextException
Specified by:
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Throws:
org.codehaus.plexus.context.ContextException

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

reload

public void reload()
            throws ContinuumException
Specified by:
reload in interface DistributedBuildManager
Throws:
ContinuumException

update

public void update(BuildAgentConfiguration agent)
            throws ContinuumException
Specified by:
update in interface DistributedBuildManager
Throws:
ContinuumException

prepareBuildProjects

public void prepareBuildProjects(Map<Integer,Integer> projectsBuildDefinitionsMap,
                                 BuildTrigger buildTrigger,
                                 int projectGroupId,
                                 String projectGroupName,
                                 String scmRootAddress,
                                 int scmRootId,
                                 List<ProjectScmRoot> scmRoots)
                          throws ContinuumException,
                                 NoBuildAgentException,
                                 NoBuildAgentInGroupException
Specified by:
prepareBuildProjects in interface DistributedBuildManager
Throws:
ContinuumException
NoBuildAgentException
NoBuildAgentInGroupException

removeDistributedBuildQueueOfAgent

public void removeDistributedBuildQueueOfAgent(String buildAgentUrl)
                                        throws ContinuumException
Specified by:
removeDistributedBuildQueueOfAgent in interface DistributedBuildManager
Throws:
ContinuumException

getProjectsInPrepareBuildQueue

public Map<String,List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue()
                                                                          throws ContinuumException
Specified by:
getProjectsInPrepareBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

getProjectsCurrentlyPreparingBuild

public Map<String,PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
                                                                        throws ContinuumException
Specified by:
getProjectsCurrentlyPreparingBuild in interface DistributedBuildManager
Throws:
ContinuumException

getProjectsCurrentlyBuilding

public Map<String,BuildProjectTask> getProjectsCurrentlyBuilding()
                                                          throws ContinuumException
Specified by:
getProjectsCurrentlyBuilding in interface DistributedBuildManager
Throws:
ContinuumException

getProjectsInBuildQueue

public Map<String,List<BuildProjectTask>> getProjectsInBuildQueue()
                                                           throws ContinuumException
Specified by:
getProjectsInBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

isBuildAgentBusy

public boolean isBuildAgentBusy(String buildAgentUrl)
Specified by:
isBuildAgentBusy in interface DistributedBuildManager

cancelDistributedBuild

public void cancelDistributedBuild(String buildAgentUrl)
                            throws ContinuumException
Specified by:
cancelDistributedBuild in interface DistributedBuildManager
Throws:
ContinuumException

cancelGroupBuild

public void cancelGroupBuild(int projectGroupId)
                      throws ContinuumException
Specified by:
cancelGroupBuild in interface DistributedBuildManager
Throws:
ContinuumException

cancelBuild

public void cancelBuild(int projectId)
                 throws ContinuumException
Specified by:
cancelBuild in interface DistributedBuildManager
Throws:
ContinuumException

getBuildResult

public Map<String,Object> getBuildResult(int projectId)
                                  throws ContinuumException
Specified by:
getBuildResult in interface DistributedBuildManager
Throws:
ContinuumException

getBuildAgentPlatform

public String getBuildAgentPlatform(String buildAgentUrl)
                             throws ContinuumException
Specified by:
getBuildAgentPlatform in interface DistributedBuildManager
Throws:
ContinuumException

getAvailableInstallations

public List<Installation> getAvailableInstallations(String buildAgentUrl)
                                             throws ContinuumException
Specified by:
getAvailableInstallations in interface DistributedBuildManager
Throws:
ContinuumException

generateWorkingCopyContent

public String generateWorkingCopyContent(int projectId,
                                         String directory,
                                         String baseUrl,
                                         String imageBaseUrl)
                                  throws ContinuumException
Specified by:
generateWorkingCopyContent in interface DistributedBuildManager
Throws:
ContinuumException

getFileContent

public Map<String,Object> getFileContent(int projectId,
                                         String directory,
                                         String filename)
                                  throws ContinuumException
Specified by:
getFileContent in interface DistributedBuildManager
Throws:
ContinuumException

removeFromPrepareBuildQueue

public void removeFromPrepareBuildQueue(String buildAgentUrl,
                                        int projectGroupId,
                                        int scmRootId)
                                 throws ContinuumException
Specified by:
removeFromPrepareBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

removeFromBuildQueue

public void removeFromBuildQueue(String buildAgentUrl,
                                 int projectId,
                                 int buildDefinitionId)
                          throws ContinuumException
Specified by:
removeFromBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

removeFromPrepareBuildQueue

public void removeFromPrepareBuildQueue(List<String> hashCodes)
                                 throws ContinuumException
Specified by:
removeFromPrepareBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

removeFromBuildQueue

public void removeFromBuildQueue(List<String> hashCodes)
                          throws ContinuumException
Specified by:
removeFromBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

isProjectInAnyPrepareBuildQueue

public boolean isProjectInAnyPrepareBuildQueue(int projectId,
                                               int buildDefinitionId)
                                        throws ContinuumException
Specified by:
isProjectInAnyPrepareBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

isProjectInAnyBuildQueue

public boolean isProjectInAnyBuildQueue(int projectId,
                                        int buildDefinitionId)
                                 throws ContinuumException
Specified by:
isProjectInAnyBuildQueue in interface DistributedBuildManager
Throws:
ContinuumException

isProjectCurrentlyPreparingBuild

public boolean isProjectCurrentlyPreparingBuild(int projectId,
                                                int buildDefinitionId)
                                         throws ContinuumException
Specified by:
isProjectCurrentlyPreparingBuild in interface DistributedBuildManager
Throws:
ContinuumException

isProjectCurrentlyBuilding

public boolean isProjectCurrentlyBuilding(int projectId,
                                          int buildDefinitionId)
                                   throws ContinuumException
Specified by:
isProjectCurrentlyBuilding in interface DistributedBuildManager
Throws:
ContinuumException

getBuildAgentUrl

public String getBuildAgentUrl(int projectId,
                               int buildDefinitionId)
                        throws ContinuumException
Specified by:
getBuildAgentUrl in interface DistributedBuildManager
Throws:
ContinuumException

isAgentAvailable

public boolean isAgentAvailable(String buildAgentUrl)
                         throws ContinuumException
Specified by:
isAgentAvailable in interface DistributedBuildManager
Throws:
ContinuumException

pingBuildAgent

public boolean pingBuildAgent(String buildAgentUrl)
                       throws ContinuumException
Specified by:
pingBuildAgent in interface DistributedBuildManager
Throws:
ContinuumException

getCurrentRuns

public List<ProjectRunSummary> getCurrentRuns()
Specified by:
getCurrentRuns in interface DistributedBuildManager

removeCurrentRun

public void removeCurrentRun(int projectId,
                             int buildDefinitionId)
Specified by:
removeCurrentRun in interface DistributedBuildManager

createSlaveBuildAgentTransportClientConnection

public SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection(String buildAgentUrl)
                                                                               throws MalformedURLException,
                                                                                      Exception
Throws:
MalformedURLException
Exception

setOverallDistributedBuildQueues

public void setOverallDistributedBuildQueues(Map<String,OverallDistributedBuildQueue> overallDistributedBuildQueues)

setConfigurationService

public void setConfigurationService(ConfigurationService configurationService)

setProjectDao

public void setProjectDao(ProjectDao projectDao)

setBuildDefinitionDao

public void setBuildDefinitionDao(BuildDefinitionDao buildDefinitionDao)

setBuildResultDao

public void setBuildResultDao(BuildResultDao buildResultDao)

setContainer

public void setContainer(org.codehaus.plexus.PlexusContainer container)

setCurrentRuns

public void setCurrentRuns(List<ProjectRunSummary> currentRuns)

setProjectScmRootDao

public void setProjectScmRootDao(ProjectScmRootDao projectScmRootDao)


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.