use of org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference in project airavata by apache.
the class StorageResourceRegister method registerGatewayStorageProfile.
public void registerGatewayStorageProfile(String storageResourceId) throws Exception {
StoragePreference localResourcePreference = null;
try {
loginNamesWithResourceIds = getLoginNamesWithResourceIDs();
List<GatewayResourceProfile> allGatewayComputeResources = airavata.getAllGatewayResourceProfiles(authzToken);
for (GatewayResourceProfile gatewayResourceProfile : allGatewayComputeResources) {
for (String resourceId : loginNamesWithResourceIds.keySet()) {
String loginUserName = loginNamesWithResourceIds.get(resourceId);
if (resourceId.equals(storageResourceId) && loginUserName.equals(LOGIN_USER)) {
localResourcePreference = createStoragePreferenceResource(resourceId, loginUserName, TestFrameworkConstants.STORAGE_LOCATION);
airavata.addGatewayStoragePreference(authzToken, gatewayResourceProfile.getGatewayID(), resourceId, localResourcePreference);
}
}
}
} catch (TException e) {
logger.error("Error occured while registering gateway storage profiles", e);
throw new Exception("Error occured while registering gateway storage profiles", e);
}
}
Aggregations