Examples of SSHSecurityContext


Examples of org.apache.airavata.gfac.ssh.security.SSHSecurityContext

        jobExecutionContext.setOutMessageContext(outMessage);

    }

  private SSHSecurityContext getSecurityContext() {
    SSHSecurityContext context = new SSHSecurityContext();
        context.setUsername("lginnali");
        context.setPrivateKeyLoc("~/.ssh/id_dsa");
        context.setKeyPass("i want to be free");
    return context;
  }
View Full Code Here

Examples of org.apache.airavata.gfac.ssh.security.SSHSecurityContext

            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();
            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 {
                String installedParentPath = "/";
                if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
                    installedParentPath = ((HpcApplicationDeploymentType)
                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
                }
                pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
                        CommonUtils.getPBSJobManager(installedParentPath));
            } catch (SSHApiException e) {
                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
            }
            sshSecurityContext.setPbsCluster(pbsCluster);
            sshSecurityContext.setUsername(sshUserName);
            jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, sshSecurityContext);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.