@Deprecated public synchronized void getJobStatuses(String userName, Map<String,JobStatus> jobIDs)throws SSHApiException { int retry = 3; RawCommandInfo rawCommandInfo = jobManagerConfiguration.getUserBasedMonitorCommand(userName); StandardOutReader stdOutReader = new StandardOutReader(); while (retry > 0){ try { log.info("Executing RawCommand : " + rawCommandInfo.getCommand()); CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader); retry=0; } catch (SSHApiException e) { retry--; try { Thread.sleep(5000); } catch (InterruptedException e1) { log.error(e1.getMessage(), e1); } reconnect(serverInfo, authenticationInfo); if (retry == 0) { throw new SSHApiException("Failed Getting statuses to remote file", e); } } } String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", jobManagerConfiguration.getBaseMonitorCommand()); jobManagerConfiguration.getParser().parseJobStatuses(userName, jobIDs, result); }
public synchronized JobStatus getJobStatus(String jobID) throws SSHApiException { RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID); StandardOutReader stdOutReader = new StandardOutReader(); log.info("Executing RawCommand : " + rawCommandInfo.getCommand()); CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader); String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", jobManagerConfiguration.getBaseMonitorCommand()); return jobManagerConfiguration.getParser().parseJobStatus(jobID, result); }
public synchronized JobDescriptor getJobDescriptorById(String jobID) throws SSHApiException { RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID); StandardOutReader stdOutReader = new StandardOutReader(); log.info("Executing RawCommand : " + rawCommandInfo.getCommand()); CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader); String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !",jobManagerConfiguration.getBaseMonitorCommand()); JobDescriptor jobDescriptor = new JobDescriptor(); jobManagerConfiguration.getParser().parseSingleJob(jobDescriptor, result); return jobDescriptor; }