// Initialize Service Stub
try {
initializeApplicationManagementStub(serverURL, username, password);
} catch (AxisFault e) {
System.out.println("Error connecting to the back-end");
throw new CommandException(e);
}
try {
if (validateLogin) {
String tenantDomain = stub.getTenantDomain();
if (logger.isDebugEnabled()) {
logger.debug("Tenant Domain {}", tenantDomain);
}
return (tenantDomain != null);
} else {
// Just return true as we don't need to validate
return true;
}
} catch (RemoteException e) {
System.out.println("Authentication failed!");
throw new CommandException(e);
}
}