agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/dao/TransferTaskDao.java
/**
	 * Sets a TransferTask and all its sub tasks to a status of TransferStatusType.CANCELLED
	 * 
	 * @param transferTask
	 * @throws TransferException
	 */
Sets a TransferTask and all its sub tasks to a status of TransferStatusType.CANCELLED

@param transferTask
@throws TransferException
Sets a TransferTask and all its sub tasks to a status of TransferStatusType . CANCELLED @param transferTask @throws TransferException
public static void cancelAllRelatedTransfers(Long transferTask) throws TransferException 
	{
		try
		{
			Session session = getSession();
			String hql = "update TransferTask t "
					+ "set t.status = :status, t.lastUpdated = :instant "
					+ "where t.status in :statuses " 
					+ "		and ( "
					+ "			t.id = :taskid "
					+ "			or (t.rootTask is not null and t.rootTask.id = :taskid) "
					+ "			or (t.parentTask is not null and t.parentTask.id = :taskid) ) ";
			session.createQuery(hql)
					.setLong("taskid", transferTask)
					.setParameter("status", TransferStatusType.CANCELLED)
					.setParameterList("statuses", TransferStatusType.getActiveStatusValues())
					.setDate("instant", new Date())
					.executeUpdate();
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception ignored) {}
			throw new TransferException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception ignored) {}
		}
	}
public static void cancelAllRelatedTransfers ( Long transferTask ) throws TransferException { try { Session session = getSession ( ) ; String hql = "update TransferTask t " + "set t.status = :status, t.lastUpdated = :instant " + "where t.status in :statuses " + "		and ( " + "			t.id = :taskid " + "			or (t.rootTask is not null and t.rootTask.id = :taskid) " + "			or (t.parentTask is not null and t.parentTask.id = :taskid) ) " ; session . createQuery ( hql ) . setLong ( "taskid" , transferTask ) . setParameter ( "status" , TransferStatusType . CANCELLED ) . setParameterList ( "statuses" , TransferStatusType . getActiveStatusValues ( ) ) . setDate ( "instant" , new Date ( ) ) . executeUpdate ( ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw new TransferException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Sets a TransferTask and all its sub tasks to a status of TransferStatusType.CANCELLED
Sets a TransferTask and all its sub tasks to a status of TransferStatusType . CANCELLED