Search in sources :

Example 1 with CredentialStoreException

use of org.apache.airavata.credential.store.exception.CredentialStoreException in project airavata by apache.

the class CredentialStoreClientFactory method createAiravataCSClient.

public static CredentialStoreService.Client createAiravataCSClient(String serverHost, int serverPort) throws CredentialStoreException {
    try {
        TTransport transport = new TSocket(serverHost, serverPort);
        transport.open();
        TProtocol protocol = new TBinaryProtocol(transport);
        return new CredentialStoreService.Client(protocol);
    } catch (TTransportException e) {
        throw new CredentialStoreException("Unable to connect to the credential store server at " + serverHost + ":" + serverPort);
    }
}
Also used : TBinaryProtocol(org.apache.thrift.protocol.TBinaryProtocol) TProtocol(org.apache.thrift.protocol.TProtocol) TTransportException(org.apache.thrift.transport.TTransportException) TTransport(org.apache.thrift.transport.TTransport) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException) TSocket(org.apache.thrift.transport.TSocket)

Example 2 with CredentialStoreException

use of org.apache.airavata.credential.store.exception.CredentialStoreException in project airavata by apache.

the class TenantProfileServiceHandler method getCredentialStoreServiceClient.

private CredentialStoreService.Client getCredentialStoreServiceClient() throws TException, ApplicationSettingsException {
    final int serverPort = Integer.parseInt(ServerSettings.getCredentialStoreServerPort());
    final String serverHost = ServerSettings.getCredentialStoreServerHost();
    try {
        return CredentialStoreClientFactory.createAiravataCSClient(serverHost, serverPort);
    } catch (CredentialStoreException e) {
        throw new TException("Unable to create credential store client...", e);
    }
}
Also used : TException(org.apache.thrift.TException) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException)

Example 3 with CredentialStoreException

use of org.apache.airavata.credential.store.exception.CredentialStoreException in project airavata by apache.

the class DefaultAiravataSecurityManager method getCredentialStoreServiceClient.

private CredentialStoreService.Client getCredentialStoreServiceClient() throws TException, ApplicationSettingsException {
    final int serverPort = Integer.parseInt(ServerSettings.getCredentialStoreServerPort());
    final String serverHost = ServerSettings.getCredentialStoreServerHost();
    try {
        return CredentialStoreClientFactory.createAiravataCSClient(serverHost, serverPort);
    } catch (CredentialStoreException e) {
        throw new TException("Unable to create credential store client...", e);
    }
}
Also used : TException(org.apache.thrift.TException) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException)

Example 4 with CredentialStoreException

use of org.apache.airavata.credential.store.exception.CredentialStoreException in project airavata by apache.

the class KeyCloakSecurityManager method getCredentialStoreServiceClient.

private CredentialStoreService.Client getCredentialStoreServiceClient() throws TException, ApplicationSettingsException {
    final int serverPort = Integer.parseInt(ServerSettings.getCredentialStoreServerPort());
    final String serverHost = ServerSettings.getCredentialStoreServerHost();
    try {
        return CredentialStoreClientFactory.createAiravataCSClient(serverHost, serverPort);
    } catch (CredentialStoreException e) {
        throw new TException("Unable to create credential store client...", e);
    }
}
Also used : TException(org.apache.thrift.TException) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException)

Example 5 with CredentialStoreException

use of org.apache.airavata.credential.store.exception.CredentialStoreException in project airavata by apache.

the class AiravataServerHandler method getCredentialStoreServiceClient.

private CredentialStoreService.Client getCredentialStoreServiceClient() throws TException, ApplicationSettingsException {
    final int serverPort = Integer.parseInt(ServerSettings.getCredentialStoreServerPort());
    final String serverHost = ServerSettings.getCredentialStoreServerHost();
    try {
        return CredentialStoreClientFactory.createAiravataCSClient(serverHost, serverPort);
    } catch (CredentialStoreException e) {
        throw new TException("Unable to create credential store client...", e);
    }
}
Also used : TException(org.apache.thrift.TException) CredentialStoreException(org.apache.airavata.credential.store.exception.CredentialStoreException)

Aggregations

CredentialStoreException (org.apache.airavata.credential.store.exception.CredentialStoreException)6 TException (org.apache.thrift.TException)5 TBinaryProtocol (org.apache.thrift.protocol.TBinaryProtocol)1 TProtocol (org.apache.thrift.protocol.TProtocol)1 TSocket (org.apache.thrift.transport.TSocket)1 TTransport (org.apache.thrift.transport.TTransport)1 TTransportException (org.apache.thrift.transport.TTransportException)1