agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Sets {@link Job#setVisible(Boolean)} to true and updates the timestamp. A {@link JobEvent} with status
     * {@link JobEventType#RESTORED} is created.
     *
     * @param jobId the db id of the job to restore.
     * @param invokingUsername the username of the user requesting the job to be restored
     * @throws JobException if unable to update the job record
     */
Sets  Job#setVisible(Boolean) to true and updates the timestamp. A  JobEvent with status
JobEventType#RESTORED is created.

@param jobId the db id of the job to restore.
@param invokingUsername the username of the user requesting the job to be restored
@throws JobException if unable to update the job record
Sets Job#setVisible ( Boolean ) to true and updates the timestamp . A JobEvent with status JobEventType#RESTORED is created . @param jobId the db id of the job to restore . @param invokingUsername the username of the user requesting the job to be restored @throws JobException if unable to update the job record
public static Job restore(long jobId, String invokingUsername) throws JobTerminationException, JobException {
        Job job = null;
        try {
            job = JobDao.getById(jobId);
            if (job == null) {
                throw new JobException("Unable to restore job. If this persists, please contact your tenant administrator.");
            } else if (!job.isVisible()) {
                try {
                    job.setVisible(Boolean.TRUE);
                    job.addEvent(new JobEvent(
                            JobEventType.RESTORED.name(),
                            "Job was restored by " + invokingUsername,
                            invokingUsername));
                    JobDao.persist(job);
                    return job;
                } catch (Throwable e) {
                    throw new JobException("Failed to restore job " + job.getUuid() + ".", e);
                }
            } else {
                throw new JobException("Job is already visible.");
            }
        } catch (UnresolvableObjectException e) {
            throw new JobException("Unable to restore job. If this persists, please contact your tenant administrator.", e);
        }
    }
public static Job restore ( long jobId , String invokingUsername ) throws JobTerminationException , JobException { Job job = null ; try { job = JobDao . getById ( jobId ) ; if ( job == null ) { throw new JobException ( "Unable to restore job. If this persists, please contact your tenant administrator." ) ; } else if ( ! job . isVisible ( ) ) { try { job . setVisible ( Boolean . TRUE ) ; job . addEvent ( new JobEvent ( JobEventType . RESTORED . name ( ) , "Job was restored by " + invokingUsername , invokingUsername ) ) ; JobDao . persist ( job ) ; return job ; } catch ( Throwable e ) { throw new JobException ( "Failed to restore job " + job . getUuid ( ) + "." , e ) ; } } else { throw new JobException ( "Job is already visible." ) ; } } catch ( UnresolvableObjectException e ) { throw new JobException ( "Unable to restore job. If this persists, please contact your tenant administrator." , e ) ; } }
Sets {@link Job#setVisible(Boolean)} to true and updates the timestamp.
Sets { @link Job#setVisible ( Boolean ) } to true and updates the timestamp .