Search in sources :

Example 1 with OpenShiftConnectionFactory

use of com.openshift.client.OpenShiftConnectionFactory in project camel by apache.

the class OpenShiftHelper method loginAndGetDomain.

public static IDomain loginAndGetDomain(OpenShiftEndpoint endpoint, String openshiftServer) {
    // grab all applications
    IOpenShiftConnection connection = new OpenShiftConnectionFactory().getConnection(endpoint.getClientId(), endpoint.getUsername(), endpoint.getPassword(), openshiftServer);
    IUser user = connection.getUser();
    IDomain domain;
    if (endpoint.getDomain() != null) {
        domain = user.getDomain(endpoint.getDomain());
    } else {
        domain = user.getDefaultDomain();
    }
    return domain;
}
Also used : IDomain(com.openshift.client.IDomain) IOpenShiftConnection(com.openshift.client.IOpenShiftConnection) IUser(com.openshift.client.IUser) OpenShiftConnectionFactory(com.openshift.client.OpenShiftConnectionFactory)

Aggregations

IDomain (com.openshift.client.IDomain)1 IOpenShiftConnection (com.openshift.client.IOpenShiftConnection)1 IUser (com.openshift.client.IUser)1 OpenShiftConnectionFactory (com.openshift.client.OpenShiftConnectionFactory)1