agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/monitors/parsers/PBSJobStatusResponseParser.java
/**
	 * Parses a job status response from the remote server response. This should be the line containing the actual
	 * status info for the PBS job, trimmed of any headers, debug info, etc.
	 *
	 * @param remoteJobId the remote job id to parse from the response
	 * @param schedulerResponseText 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 job status response from the remote server response. This should be the line containing the actual
status info for the PBS job, trimmed of any headers, debug info, etc.

@param remoteJobId the remote job id to parse from the response
@param schedulerResponseText 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 job status response from the remote server response . This should be the line containing the actual status info for the PBS job trimmed of any headers debug info etc . @param remoteJobId the remote job id to parse from the response @param schedulerResponseText 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<PBSJobStatus> parseLine(String remoteJobId, String schedulerResponseText) throws RemoteJobMonitorResponseParsingException {
		Properties props = new Properties();
		PBSJobStatus remoteJobStatus = PBSJobStatus.UNKNOWN;
		String exitCode = null;
		try (InputStream bis = new ByteArrayInputStream(schedulerResponseText.getBytes())) {
			props.load(bis);
			if (props.containsKey("job_state")) {
				remoteJobStatus = PBSJobStatus.valueOfCode(props.getProperty("job_state"));
			} else {
				throw new RemoteJobMonitorResponseParsingException("Unable to find job status in the response from the scheduler");
			}
			if (props.containsKey("Exit_status")) {
				exitCode = props.getProperty("Exit_status");
			}
			return new JobStatusResponse<>(remoteJobId, remoteJobStatus, exitCode);
		} catch (IOException e) {
			throw new RemoteJobMonitorResponseParsingException("Unable to parse the response from the scheduler");
		}
	}
protected JobStatusResponse < PBSJobStatus > parseLine ( String remoteJobId , String schedulerResponseText ) throws RemoteJobMonitorResponseParsingException { Properties props = new Properties ( ) ; PBSJobStatus remoteJobStatus = PBSJobStatus . UNKNOWN ; String exitCode = null ; try ( InputStream bis = new ByteArrayInputStream ( schedulerResponseText . getBytes ( ) ) ) { props . load ( bis ) ; if ( props . containsKey ( "job_state" ) ) { remoteJobStatus = PBSJobStatus . valueOfCode ( props . getProperty ( "job_state" ) ) ; } else { throw new RemoteJobMonitorResponseParsingException ( "Unable to find job status in the response from the scheduler" ) ; } if ( props . containsKey ( "Exit_status" ) ) { exitCode = props . getProperty ( "Exit_status" ) ; } return new JobStatusResponse < > ( remoteJobId , remoteJobStatus , exitCode ) ; } catch ( IOException e ) { throw new RemoteJobMonitorResponseParsingException ( "Unable to parse the response from the scheduler" ) ; } }
Parses a job status response from the remote server response.
Parses a job status response from the remote server response .