Search in sources :

Example 41 with RegistryServiceException

use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.

the class RegistryServerHandler method deleteStorageResource.

/**
 * Delete a Storage Resource.
 *
 * @param storageResourceId The identifier of the requested compute resource to be deleted.
 * @return status
 * Returns a success/failure of the deletion.
 */
@Override
public boolean deleteStorageResource(String storageResourceId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        appCatalog.getStorageResource().removeStorageResource(storageResourceId);
        logger.debug("Airavata deleted storage resource with storage resource Id : " + storageResourceId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(storageResourceId, "Error while deleting storage resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while deleting storage resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 42 with RegistryServiceException

use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.

the class RegistryServerHandler method updateApplicationInterface.

/**
 * Update a Application Interface.
 *
 * @param appInterfaceId       The identifier of the requested application deployment to be updated.
 * @param applicationInterface
 * @return status
 * Returns a success/failure of the update.
 */
@Override
public boolean updateApplicationInterface(String appInterfaceId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        appCatalog.getApplicationInterface().updateApplicationInterface(appInterfaceId, applicationInterface);
        logger.debug("Airavata updated application interface with interface id : " + appInterfaceId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(appInterfaceId, "Error while updating application interface...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while updating application interface. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 43 with RegistryServiceException

use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.

the class RegistryServerHandler method updateUserResourceProfile.

/**
 * Update a User Resource Profile.
 *
 * @param gatewayID              The identifier for the requested gateway resource to be updated.
 * @param userResourceProfile Gateway Resource Profile Object.
 * @return status
 * Returns a success/failure of the update.
 */
@Override
public boolean updateUserResourceProfile(String userId, String gatewayID, UserResourceProfile userResourceProfile) throws RegistryServiceException, TException {
    try {
        if (!ExpCatResourceUtils.isUserExist(userId, gatewayID)) {
            logger.error("User does not exist.Please provide a valid user id...");
            throw new RegistryServiceException("user does not exist.Please provide a valid user id...");
        }
        appCatalog = RegistryFactory.getAppCatalog();
        UsrResourceProfile userProfile = appCatalog.getUserResourceProfile();
        userProfile.updateUserResourceProfile(userId, gatewayID, userResourceProfile);
        logger.debug("Airavata updated gateway profile with gateway id : " + userId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(gatewayID, "Error while updating gateway resource profile...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while updating gateway 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;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 44 with RegistryServiceException

use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.

the class RegistryServerHandler method getSCPDataMovement.

/**
 * This method returns SCP datamovement object
 *
 * @param dataMovementId The identifier of the datamovement Interface to be retrieved.
 * @return SCPDataMovement instance
 */
@Override
public SCPDataMovement getSCPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        SCPDataMovement scpDataMovement = appCatalog.getComputeResource().getSCPDataMovement(dataMovementId);
        logger.debug("Airavata retrieved SCP data movement with data movement id: " + dataMovementId);
        return scpDataMovement;
    } catch (AppCatalogException e) {
        String errorMsg = "Error while retrieving SCP data movement interface to resource compute resource...";
        logger.error(dataMovementId, errorMsg, e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage(errorMsg + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 45 with RegistryServiceException

use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.

the class RegistryServerHandler method registerApplicationInterface.

/**
 * Register a Application Interface.
 *
 * @param gatewayId
 * @param applicationInterface Application Module Object created from the datamodel.
 * @return appInterfaceId
 * Returns a server-side generated airavata application interface globally unique identifier.
 */
@Override
public String registerApplicationInterface(String gatewayId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
    if (!isGatewayExistInternal(gatewayId)) {
        logger.error("Gateway does not exist.Please provide a valid gateway id...");
        throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
    }
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        String interfaceId = appCatalog.getApplicationInterface().addApplicationInterface(applicationInterface, gatewayId);
        logger.debug("Airavata registered application interface for gateway id : " + gatewayId);
        return interfaceId;
    } catch (AppCatalogException e) {
        logger.error("Error while adding application interface...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while adding application interface. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Aggregations

RegistryServiceException (org.apache.airavata.registry.api.exception.RegistryServiceException)131 TException (org.apache.thrift.TException)28 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)26 GatewayResourceProfile (org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile)9 UserResourceProfile (org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile)5 ApplicationDeploymentDescription (org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)4 ApplicationInterfaceDescription (org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription)4 UserComputeResourcePreference (org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference)4 UserStoragePreference (org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference)4 DataProductModel (org.apache.airavata.model.data.replica.DataProductModel)4 JobModel (org.apache.airavata.model.job.JobModel)3 ProcessModel (org.apache.airavata.model.process.ProcessModel)3 ExperimentState (org.apache.airavata.model.status.ExperimentState)3 ExperimentStatus (org.apache.airavata.model.status.ExperimentStatus)3 Project (org.apache.airavata.model.workspace.Project)3 CredentialStoreService (org.apache.airavata.credential.store.cpi.CredentialStoreService)2 ApplicationModule (org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)2 ComputeResourcePreference (org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference)2 StoragePreference (org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference)2 PasswordCredential (org.apache.airavata.model.credential.store.PasswordCredential)2