private String verifyJobSubmission(Cluster cluster, JobDetails jobDetails) { String jobName = jobDetails.getJobName(); String jobId = null; try { jobId = cluster.getJobIdByJobName(jobName, cluster.getServerInfo().getUserName()); } catch (SSHApiException e) { log.error("Error while verifying JobId from JobName"); } return jobId; }
public HPCMonitorID(AuthenticationInfo authenticationInfo, JobExecutionContext jobExecutionContext) { super(jobExecutionContext); this.authenticationInfo = authenticationInfo; if (this.authenticationInfo != null) { try { String hostAddress = jobExecutionContext.getHostName(); SecurityContext securityContext = jobExecutionContext.getSecurityContext(hostAddress); ServerInfo serverInfo = null; if (securityContext != null) { if (securityContext instanceof GSISecurityContext){ serverInfo = (((GSISecurityContext) securityContext).getPbsCluster()).getServerInfo(); if (serverInfo.getUserName() != null) { setUserName(serverInfo.getUserName()); } } if (securityContext instanceof SSHSecurityContext){ serverInfo = (((SSHSecurityContext) securityContext).getPbsCluster()).getServerInfo(); if (serverInfo.getUserName() != null) { setUserName(serverInfo.getUserName()); } } } } catch (GFacException e) { logger.error("Error while getting security context", e); } } }