}
private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
JobExecutionContext jobExecutionContext) {
if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType) {
GSISecurityContext context = new GSISecurityContext();
context.setMyproxyLifetime(Integer.parseInt(configurationProperties.getProperty(Constants.MYPROXY_LIFE)));
context.setMyproxyServer(configurationProperties.getProperty(Constants.MYPROXY_SERVER));
context.setMyproxyUserName(configurationProperties.getProperty(Constants.MYPROXY_USER));
context.setMyproxyPasswd(configurationProperties.getProperty(Constants.MYPROXY_PASS));
context.setTrustedCertLoc(configurationProperties.getProperty(Constants.TRUSTED_CERT_LOCATION));
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) {
SSHSecurityContext context = new SSHSecurityContext();
context.setUsername(configurationProperties.getProperty(Constants.SSH_USER_NAME));
context.setPrivateKeyLoc(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY));
context.setKeyPass(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS));
jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, context);
}
}