}
if (registeredHost.getType() instanceof GsisshHostType) {
GSIAuthenticationInfo authenticationInfo
= new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
Cluster pbsCluster = null;
try {
pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
(((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
} catch (SSHApiException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
context.setPbsCluster(pbsCluster);
}
jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
} else if (registeredHost.getType() instanceof Ec2HostType) {
if (this.configuration.getAmazonSecurityContext() != null) {
jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
this.configuration.getAmazonSecurityContext());
}
} else if (registeredHost.getType() instanceof SSHHostType) {
String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
String sshPrivateKey = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY);
String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
AuthenticationInfo authenticationInfo = null;
// we give higher preference to the password over keypair ssh authentication
if (sshPassword != null) {
authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
} else {
authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
}
ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());
Cluster pbsCluster = null;
try {
pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
(((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));