Search in sources :

Example 11 with StoragePreference

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);
    }
}
Also used : TException(org.apache.thrift.TException) GatewayResourceProfile(org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile) StoragePreference(org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference) TException(org.apache.thrift.TException)

Aggregations

StoragePreference (org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference)11 ComputeResourcePreference (org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference)4 UserStoragePreference (org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference)4 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)4 GatewayResourceProfile (org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile)3 RegistryServiceException (org.apache.airavata.registry.api.exception.RegistryServiceException)3 HashMap (java.util.HashMap)2 TException (org.apache.thrift.TException)2 ArrayList (java.util.ArrayList)1 AiravataException (org.apache.airavata.common.exception.AiravataException)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 CredentialStoreException (org.apache.airavata.credential.store.exception.CredentialStoreException)1 StorageResourceDescription (org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription)1 RegistryService (org.apache.airavata.registry.api.RegistryService)1 SecurityCheck (org.apache.airavata.service.security.interceptor.SecurityCheck)1 SharingRegistryService (org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService)1