}
public void cancelDistributedBuild( String buildAgentUrl, int projectGroupId, String scmRootAddress )
throws ContinuumException
{
DistributedBuildTaskQueueExecutor taskQueueExecutor = taskQueueExecutors.get( buildAgentUrl );
if ( taskQueueExecutor != null )
{
if ( taskQueueExecutor.getCurrentTask() != null )
{
if ( taskQueueExecutor.getCurrentTask() instanceof PrepareBuildProjectsTask )
{
PrepareBuildProjectsTask currentTask = (PrepareBuildProjectsTask) taskQueueExecutor.getCurrentTask()
;
if ( currentTask.getProjectGroupId() == projectGroupId &&
currentTask.getScmRootAddress().equals( scmRootAddress ) )
{
log.info( "cancelling task for project group " + projectGroupId + " with scm root address " +
scmRootAddress );
taskQueueExecutor.cancelTask( currentTask );
try
{
SlaveBuildAgentTransportClient client =
new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );