agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/monitors/parsers/LSFJobStatusResponseParser.java
/**
	 * Parses a single status line from the remote server response. Job id, username, and status cannot contain
	 * spaces, so it is sufficient to split the status line and use the tokens. Expected format is:
	 * <pre>
	 * 114     testuser RUN   normal     fc0b07ca1fb9 fc0b07ca1fb9 test_job   May  9 02:59
	 * </pre>
	 * @param remoteJobId the remote job id to parse from the response
	 * @param statusLine the qstat job status line
	 * @return a {@link JobStatusResponse} containing remote status info about the job with {@code remoteJobId}
	 * @throws RemoteJobMonitorResponseParsingException if unable to parse the job status
	 */
Parses a single status line from the remote server response. Job id, username, and status cannot contain
spaces, so it is sufficient to split the status line and use the tokens. Expected format is:

114     testuser RUN   normal     fc0b07ca1fb9 fc0b07ca1fb9 test_job   May  9 02:59

@param remoteJobId the remote job id to parse from the response
@param statusLine the qstat job status line
@return a  JobStatusResponse containing remote status info about the job with  remoteJobId
@throws RemoteJobMonitorResponseParsingException if unable to parse the job status
Parses a single status line from the remote server response . Job id username and status cannot contain spaces so it is sufficient to split the status line and use the tokens . Expected format is : 114 testuser RUN normal fc0b07ca1fb9 fc0b07ca1fb9 test_job May 9 02 : 59 @param remoteJobId the remote job id to parse from the response @param statusLine the qstat job status line @return a JobStatusResponse containing remote status info about the job with remoteJobId @throws RemoteJobMonitorResponseParsingException if unable to parse the job status
protected JobStatusResponse<LSFJobStatus> parseLine(String remoteJobId, String statusLine) throws RemoteJobMonitorResponseParsingException {
		List<String> tokens = Arrays.asList(StringUtils.split(statusLine));
		if (StringUtils.isNotBlank(tokens.get(0)) && remoteJobId.equals(tokens.get(0))) {
			try {
				LSFJobStatus remoteJobStatus = LSFJobStatus.valueOfCode(tokens.get(2));
				String exitCode = "0";
				return new JobStatusResponse<>(remoteJobId, remoteJobStatus, exitCode);
			}
			catch (Throwable e) {
				throw new RemoteJobMonitorResponseParsingException("Unexpected fields in the response from the scheduler");
			}
		}
		else {
			throw new RemoteJobMonitorResponseParsingException(
					"Unable to obtain job status in the response from the scheduler: " + statusLine);
		}
	}
protected JobStatusResponse < LSFJobStatus > parseLine ( String remoteJobId , String statusLine ) throws RemoteJobMonitorResponseParsingException { List < String > tokens = Arrays . asList ( StringUtils . split ( statusLine ) ) ; if ( StringUtils . isNotBlank ( tokens . get ( 0 ) ) && remoteJobId . equals ( tokens . get ( 0 ) ) ) { try { LSFJobStatus remoteJobStatus = LSFJobStatus . valueOfCode ( tokens . get ( 2 ) ) ; String exitCode = "0" ; return new JobStatusResponse < > ( remoteJobId , remoteJobStatus , exitCode ) ; } catch ( Throwable e ) { throw new RemoteJobMonitorResponseParsingException ( "Unexpected fields in the response from the scheduler" ) ; } } else { throw new RemoteJobMonitorResponseParsingException ( "Unable to obtain job status in the response from the scheduler: " + statusLine ) ; } }
Parses a single status line from the remote server response.
Parses a single status line from the remote server response .