use of org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile in project airavata by apache.
the class RegistryServerHandler method getUserResourceProfile.
/**
* Fetch the given Gateway Resource Profile.
*
* @param userId The identifier for the requested user resource.
* @return UserResourceProfile object
*/
@Override
public UserResourceProfile getUserResourceProfile(String userId, String gatewayId) throws RegistryServiceException, TException {
try {
if (!ExpCatResourceUtils.isUserExist(userId, gatewayId)) {
logger.error("user does not exist.Please provide a valid gateway id...");
throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
}
appCatalog = RegistryFactory.getAppCatalog();
UsrResourceProfile usrResourceProfile = appCatalog.getUserResourceProfile();
UserResourceProfile userResourceProfile = usrResourceProfile.getUserResourceProfile(userId, gatewayId);
logger.debug("Airavata retrieved User resource profile with user id : " + userId);
return userResourceProfile;
} catch (AppCatalogException e) {
logger.error(userId, "Error while retrieving user resource profile...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while retrieving user resource profile. More info : " + e.getMessage());
throw exception;
} catch (RegistryException e) {
logger.error(userId, "Error while retrieving user resource profile...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while retrieving user resource profile. More info : " + e.getMessage());
throw exception;
}
}
Aggregations