agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/monitors/AbstractJobMonitor.java
/**
     * Queries job directory to get the most recently modified log file and returns that date.
     * <strong>note:</strong> this is being deprecated in favor of querying the scheduler for
     * individual job info.
     *
     * @return returns the {@link Date} of the most recently modified log file for the job.
     * @deprecated
     */
Queries job directory to get the most recently modified log file and returns that date.
note: this is being deprecated in favor of querying the scheduler for
individual job info.

@return returns the  Date of the most recently modified log file for the job.
@deprecated
Queries job directory to get the most recently modified log file and returns that date . note : this is being deprecated in favor of querying the scheduler for individual job info . @return returns the Date of the most recently modified log file for the job . @deprecated
protected Date fetchEndDateFromLogFiles()
    {
        RemoteDataClient remoteDataClient = null;
        RemoteFileInfo stdOutFileInfo;
        RemoteFileInfo stdErrFileInfo;
        Date errDate = null;
        Date outDate = null;
        Date logDate = new DateTime().toDate();
        try
        {   log.debug("Attempting to fetch completion time for job " + job.getUuid() + " from logfile timestamps");
            remoteDataClient = getAuthenticatedRemoteDataClient();
            SubmitScript script = SubmitScriptFactory.getInstance(getJob(),
                    SoftwareDao.getSoftwareByUniqueName(getJob().getSoftwareName()),
                    getExecutionSystem());
            String stdOut = job.getWorkPath() + "/" + script.getStandardOutputFile();
            String stdErr = job.getWorkPath() + "/" + script.getStandardErrorFile();
            if (remoteDataClient.doesExist(stdErr)) {
                stdErrFileInfo = remoteDataClient.getFileInfo(stdErr);
                errDate = stdErrFileInfo.getLastModified();
            }
            if (remoteDataClient.doesExist(stdOut)) {
                stdOutFileInfo = remoteDataClient.getFileInfo(stdOut);
                outDate = stdOutFileInfo.getLastModified();
            }
        } catch (Throwable e) {
            log.error("Failed to retrieve completion timestamp for job " + job.getUuid() +
                    " from logfile timestamps.", e);
        }
        finally {
        	try {
                if (remoteDataClient != null) {
                    remoteDataClient.disconnect();
                }
            } catch (Exception ignored) {}
        	remoteDataClient = null;
        }
        if (errDate != null && outDate != null) {
            if (errDate.compareTo(outDate) >= 0) {
                logDate = errDate;
            } else {
                logDate = outDate;
            }
        } else if (errDate != null) {
            logDate = errDate;
        } else if (outDate != null) {
            logDate = outDate;
        }
        if (job.getStartTime() != null && logDate.after(job.getStartTime())) {
            return logDate;
        } else {
            return new DateTime().toDate();
        }
    }
protected Date fetchEndDateFromLogFiles ( ) { RemoteDataClient remoteDataClient = null ; RemoteFileInfo stdOutFileInfo ; RemoteFileInfo stdErrFileInfo ; Date errDate = null ; Date outDate = null ; Date logDate = new DateTime ( ) . toDate ( ) ; try { log . debug ( "Attempting to fetch completion time for job " + job . getUuid ( ) + " from logfile timestamps" ) ; remoteDataClient = getAuthenticatedRemoteDataClient ( ) ; SubmitScript script = SubmitScriptFactory . getInstance ( getJob ( ) , SoftwareDao . getSoftwareByUniqueName ( getJob ( ) . getSoftwareName ( ) ) , getExecutionSystem ( ) ) ; String stdOut = job . getWorkPath ( ) + "/" + script . getStandardOutputFile ( ) ; String stdErr = job . getWorkPath ( ) + "/" + script . getStandardErrorFile ( ) ; if ( remoteDataClient . doesExist ( stdErr ) ) { stdErrFileInfo = remoteDataClient . getFileInfo ( stdErr ) ; errDate = stdErrFileInfo . getLastModified ( ) ; } if ( remoteDataClient . doesExist ( stdOut ) ) { stdOutFileInfo = remoteDataClient . getFileInfo ( stdOut ) ; outDate = stdOutFileInfo . getLastModified ( ) ; } } catch ( Throwable e ) { log . error ( "Failed to retrieve completion timestamp for job " + job . getUuid ( ) + " from logfile timestamps." , e ) ; } finally { try { if ( remoteDataClient != null ) { remoteDataClient . disconnect ( ) ; } } catch ( Exception ignored ) { } remoteDataClient = null ; } if ( errDate != null && outDate != null ) { if ( errDate . compareTo ( outDate ) >= 0 ) { logDate = errDate ; } else { logDate = outDate ; } } else if ( errDate != null ) { logDate = errDate ; } else if ( outDate != null ) { logDate = outDate ; } if ( job . getStartTime ( ) != null && logDate . after ( job . getStartTime ( ) ) ) { return logDate ; } else { return new DateTime ( ) . toDate ( ) ; } }
Queries job directory to get the most recently modified log file and returns that date.
Queries job directory to get the most recently modified log file and returns that date .
// get the output filenames from the SubmitScript for the job.