return getAPI(registryURL, gateway, username, username, callback);
}
public static AiravataAPI getAPI(URI registryURL, String gateway, String username, String alternateUsername, PasswordCallback callback) throws AiravataAPIInvocationException{
try {
AiravataAPI apiObj = new AiravataClient();
apiObj.setCurrentUser(alternateUsername);
apiObj.setCallBack(callback);
apiObj.setRegitryURI(registryURL);
apiObj.setGateway(gateway);
apiObj.initialize();
return apiObj;
} catch (Exception e) {
throw new AiravataAPIInvocationException(e);
}
}