agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/queue/ZombieJobWatch.java
/**
	 * Cancel all transfer tasks for this job prior to rolling
	 * back the status so there won't be new transfers
	 * started before the status is updated.
	 *
	 * @param job the job for which to cancel transfers
	 * @param callingUsername the principal canceling transfers for the job
	 */
Cancel all transfer tasks for this job prior to rolling
back the status so there won't be new transfers
started before the status is updated.

@param job the job for which to cancel transfers
@param callingUsername the principal canceling transfers for the job
Cancel all transfer tasks for this job prior to rolling back the status so there won ' t be new transfers started before the status is updated . @param job the job for which to cancel transfers @param callingUsername the principal canceling transfers for the job
private void cancelCurrentTransfers(Job job, String callingUsername)
	{
    	for (JobEvent event: job.getEvents())
		{
			if (event.getTransferTask() != null)
			{
				try
				{
					log.debug("Zombie reaper task is cancelling transfer task "
							+ event.getTransferTask().getUuid() + " for job " + job.getUuid());
					TransferTaskDao.cancelAllRelatedTransfers(event.getTransferTask().getId());
					NotificationManager.process(event.getTransferTask().getUuid(), TransferTaskEventType.CANCELLED.name(), callingUsername, event.getTransferTask().toJSON());
				} catch (Throwable e) {
					log.error("Failed to cancel transfer task " +
							event.getTransferTask().getUuid() + " associated with job " + job.getUuid(), e);
				}
			}
		}
	}
private void cancelCurrentTransfers ( Job job , String callingUsername ) { for ( JobEvent event : job . getEvents ( ) ) { if ( event . getTransferTask ( ) != null ) { try { log . debug ( "Zombie reaper task is cancelling transfer task " + event . getTransferTask ( ) . getUuid ( ) + " for job " + job . getUuid ( ) ) ; TransferTaskDao . cancelAllRelatedTransfers ( event . getTransferTask ( ) . getId ( ) ) ; NotificationManager . process ( event . getTransferTask ( ) . getUuid ( ) , TransferTaskEventType . CANCELLED . name ( ) , callingUsername , event . getTransferTask ( ) . toJSON ( ) ) ; } catch ( Throwable e ) { log . error ( "Failed to cancel transfer task " + event . getTransferTask ( ) . getUuid ( ) + " associated with job " + job . getUuid ( ) , e ) ; } } } }
Cancel all transfer tasks for this job prior to rolling
 back the status so there won't be new transfers
 started before the status is updated.
Cancel all transfer tasks for this job prior to rolling back the status so there won ' t be new transfers started before the status is updated .
// iterate over all job events // wherever a transfer task is found for an event, cancel it. This will // issue a single SQL update query to set {@link TransferTask#status} to // {@link TransferStatusType#CANCELLED}