Package org.apache.airavata.credential.store.credential.impl.ssh

Examples of org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential


        credentialsDAO = new CredentialsDAO();
    }

    public void writeCredentials(Credential credential) throws CredentialStoreException {

        SSHCredential sshCredential = (SSHCredential) credential;
        Connection connection = null;

        try {
            connection = dbUtil.getConnection();
            // First delete existing credentials
            credentialsDAO.deleteCredentials(sshCredential.getGateway(), sshCredential.getToken(), connection);
            // Add the new certificate
            credentialsDAO.addCredentials(sshCredential.getGateway(), credential, connection);

            if (!connection.getAutoCommit()) {
                connection.commit();
            }
View Full Code Here


  @Override
  public boolean isCredentialExist(String gatewayId, String tokenId)
      throws RegistryException {
    credentialReader = new CredentialReaderImpl(getDBConnector());
    try {
      SSHCredential credential = (SSHCredential) credentialReader.getCredential(gatewayId, tokenId);
        if (credential!=null) {
          return true;
        }
    } catch(CredentialStoreException e) {
      return false;
View Full Code Here

  public String getCredentialPublicKey(String gatewayId, String tokenId)
      throws RegistryException {
   
    credentialReader = new CredentialReaderImpl(getDBConnector());
    try {
      SSHCredential credential = (SSHCredential) credentialReader.getCredential(gatewayId, tokenId);
        if (credential!=null) {
          return new String(credential.getPublicKey());
        }
    } catch(CredentialStoreException e) {
      return null;
    }
    return null;
View Full Code Here

  public String createCredential(String gatewayId, String tokenId,
      String username) throws RegistryException {
      credentialWriter = new SSHCredentialWriter(getDBConnector());
      credentialGenerator = new SSHCredentialGenerator();
      try {
        SSHCredential credential = credentialGenerator.generateCredential(tokenId);
        if (credential!=null) {
          credential.setGateway(gatewayId);
          credential.setToken(tokenId);
          credential.setPortalUserName(username);
            credentialWriter.writeCredentials(credential);
            return new String(credential.getPublicKey());
        }
      } catch (CredentialStoreException e) {
        return null;
      }
    return null;
View Full Code Here

TOP

Related Classes of org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential

Copyright © 2018 www.massapicom. 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.