ConfigurationService configurationService = continuum.getConfiguration();
boolean SUCCESS;
org.apache.continuum.configuration.BuildAgentConfiguration buildAgent = configurationService.getBuildAgent(
url );
BuildAgentConfiguration buildAgentConfiguration = buildAgent != null ? populateBuildAgent( buildAgent ) : null;
if ( buildAgentConfiguration != null )
{
if ( continuum.getDistributedBuildManager().isBuildAgentBusy( buildAgentConfiguration.getUrl() ) )
{
throw new BuildAgentConfigurationException(
"Cannot delete build agent because it's busy at the moment" );
}
if ( configurationService.getBuildAgentGroups() != null )
{
for ( org.apache.continuum.configuration.BuildAgentGroupConfiguration buildAgentGroup : configurationService.getBuildAgentGroups() )
{
if ( configurationService.containsBuildAgentUrl( buildAgentConfiguration.getUrl(),
buildAgentGroup ) )
{
throw new BuildAgentConfigurationException(
"Cannot delete build agent because it's in use at the moment" );
}
}
}
try
{
continuum.getDistributedBuildManager().removeDistributedBuildQueueOfAgent(
buildAgentConfiguration.getUrl() );
configurationService.removeBuildAgent( populateBuildAgent( buildAgentConfiguration ) );
configurationService.store();
SUCCESS = true;
}
catch ( ContinuumException e )