agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/monitors/parsers/PBSJobStatusResponseParser.java
/**
	 * The job status query to PBS was of the form {@code "qstat -x -f <job_id>}. That means the response should
	 * come back in a format that can be parsed into a Properties object.
	 *
	 * @param remoteJobId the remote job id to parse from the response
	 * @param schedulerResponseText the response text from the remote scheduler
	 * @return a {@link JobStatusResponse} containing remote status info about the job with {@code remoteJobId}
	 * @throws RemoteJobMonitorEmptyResponseException if {@code schedulerResponseText} is blank
	 * @throws RemoteJobMonitorResponseParsingException if {@code schedulerResponseText} could not be parsed
	 */
The job status query to PBS was of the form  "qstat -x -f . That means the response should
come back in a format that can be parsed into a Properties object.


The job status query to PBS was of the form " qstat - x - f . That means the response should come back in a format that can be parsed into a Properties object .
@Override
	public JobStatusResponse parse(String remoteJobId, String schedulerResponseText) throws RemoteJobMonitorEmptyResponseException, RemoteJobMonitorResponseParsingException {
		if (StringUtils.isBlank(schedulerResponseText)) {
			throw new RemoteJobMonitorEmptyResponseException(
					"Empty response received from job status check on the remote system. Since the job was " +
							"successfully placed into queue, this is likely caused by a communication issue with the " +
							"scheduler. Retrying may clear up the issue.");
		} else if (schedulerResponseText.toLowerCase().contains("qstat: unknown job id")) {
			throw new RemoteJobMonitorEmptyResponseException(
					"Error response from job status check on the remote system. This is likely due to the job " +
							"completing and being purged from the qstat job cache. Calling tracejob with sufficient " +
							"permissions or examining the job logs should provide more information about the job.");
		}
		else if (!schedulerResponseText.toLowerCase().startsWith("job id:")) {
			throw new RemoteJobMonitorResponseParsingException("Unable to obtain job status in the response from the scheduler: " + schedulerResponseText);
		} else {
			return parseFullStatus(remoteJobId, schedulerResponseText);
		}
	}
@ Override public JobStatusResponse parse ( String remoteJobId , String schedulerResponseText ) throws RemoteJobMonitorEmptyResponseException , RemoteJobMonitorResponseParsingException { if ( StringUtils . isBlank ( schedulerResponseText ) ) { throw new RemoteJobMonitorEmptyResponseException ( "Empty response received from job status check on the remote system. Since the job was " + "successfully placed into queue, this is likely caused by a communication issue with the " + "scheduler. Retrying may clear up the issue." ) ; } else if ( schedulerResponseText . toLowerCase ( ) . contains ( "qstat: unknown job id" ) ) { throw new RemoteJobMonitorEmptyResponseException ( "Error response from job status check on the remote system. This is likely due to the job " + "completing and being purged from the qstat job cache. Calling tracejob with sufficient " + "permissions or examining the job logs should provide more information about the job." ) ; } else if ( ! schedulerResponseText . toLowerCase ( ) . startsWith ( "job id:" ) ) { throw new RemoteJobMonitorResponseParsingException ( "Unable to obtain job status in the response from the scheduler: " + schedulerResponseText ) ; } else { return parseFullStatus ( remoteJobId , schedulerResponseText ) ; } }
The job status query to PBS was of the form {@code "qstat -x -f <job_id>}.
The job status query to PBS was of the form { @code " qstat - x - f <job_id > } .
//			List<String> lines = Arrays.asList(StringUtils.stripToEmpty(schedulerResponseText).split("[\\r\\n]+")); //			// iterate over each line, finding the one starting with the job id //			for (String line: lines) { //				// PBS status lines start with the job id //				if (line.startsWith(remoteJobId)) { //					try { //						// parse the line with the status info in it //						return parseLine(remoteJobId, line); //					} catch (RemoteJobMonitorResponseParsingException e) { //						throw new RemoteJobMonitorResponseParsingException(e.getMessage() + ": " + schedulerResponseText, e); //					} //				} //			} //			throw new RemoteJobMonitorResponseParsingException("Unable to obtain job status in the response from the scheduler");