agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Sets the job's visibility attribute to false and
     * updates the timestamp. A {@link JobEventType#DELETED} event
     * is thrown.
     *
     * @param jobId jhe db id of the job to hide
	 * @param invokingUsername username of the user making the request
     * @throws JobException if unable to hide the job
     */
Sets the job's visibility attribute to false and
updates the timestamp. A  JobEventType#DELETED event
is thrown.

@param jobId jhe db id of the job to hide
@param invokingUsername username of the user making the request
@throws JobException if unable to hide the job
Sets the job ' s visibility attribute to false and updates the timestamp . A JobEventType#DELETED event is thrown . @param jobId jhe db id of the job to hide @param invokingUsername username of the user making the request @throws JobException if unable to hide the job
public static Job hide(long jobId, String invokingUsername) throws JobTerminationException, JobException {
        Job job = JobDao.getById(jobId);
		if (job == null) {
			throw new JobException("Unable to restore job. If this persists, please contact your tenant administrator.");
		}
        if (job.isRunning())
            try {
                kill(job);
            } catch (Exception e) {
                String msg = "Unable to kill job " + job.getUuid() + ". Aborting hide operation.";
                log.error(msg, e);
                throw new JobException(msg, e);
            }
        try {
            job.setVisible(Boolean.FALSE);
            Date jobHiddenDate = new DateTime().toDate();
            job.setLastUpdated(jobHiddenDate);
            job.addEvent(new JobEvent(
                    JobEventType.DELETED.name(),
                    "Job was deleted by user " + invokingUsername + ".",
                    invokingUsername));
            JobDao.persist(job);
        } catch (Throwable e) {
            String msg = "Failed to hide job " + job.getUuid() + ".";
            log.error(msg, e);
            throw new JobException(msg, e);
        }
        return job;
    }
public static Job hide ( long jobId , String invokingUsername ) throws JobTerminationException , JobException { Job job = JobDao . getById ( jobId ) ; if ( job == null ) { throw new JobException ( "Unable to restore job. If this persists, please contact your tenant administrator." ) ; } if ( job . isRunning ( ) ) try { kill ( job ) ; } catch ( Exception e ) { String msg = "Unable to kill job " + job . getUuid ( ) + ". Aborting hide operation." ; log . error ( msg , e ) ; throw new JobException ( msg , e ) ; } try { job . setVisible ( Boolean . FALSE ) ; Date jobHiddenDate = new DateTime ( ) . toDate ( ) ; job . setLastUpdated ( jobHiddenDate ) ; job . addEvent ( new JobEvent ( JobEventType . DELETED . name ( ) , "Job was deleted by user " + invokingUsername + "." , invokingUsername ) ) ; JobDao . persist ( job ) ; } catch ( Throwable e ) { String msg = "Failed to hide job " + job . getUuid ( ) + "." ; log . error ( msg , e ) ; throw new JobException ( msg , e ) ; } return job ; }
Sets the job's visibility attribute to false and
 updates the timestamp.
Sets the job ' s visibility attribute to false and updates the timestamp .
// Get the job and process it even if it's already hidden // so that we get another opportunity to kill it. // If the job is running, try to stop it and cancel all queued work. // Remember, there are built-in race conditions with polling quartz // job, so we can never be sure when the job state changes from // underneath us. // We assume the job is in some state that won't cause a polling quartz job // to start processing it because (1) the above kill operation put it into // such as state, or (2) the kill operation threw an exception and we // never get here, or (3) the job was already in such a state when this method // was called. // Update the job fields even if the job is already hidden.