Search in sources :

Example 76 with RegistryServiceException

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

the class RegistryServerHandler method getApplicationModule.

/**
 * Fetch a Application Module.
 *
 * @param appModuleId The unique identifier of the application module required
 * @return applicationModule
 * Returns an Application Module Object.
 */
@Override
public ApplicationModule getApplicationModule(String appModuleId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ApplicationModule module = appCatalog.getApplicationInterface().getApplicationModule(appModuleId);
        logger.debug("Airavata retrieved application module with module id : " + appModuleId);
        return module;
    } catch (AppCatalogException e) {
        logger.error(appModuleId, "Error while retrieving application module...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving the adding application module. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) ApplicationModule(org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)

Example 77 with RegistryServiceException

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

the class RegistryServerHandler method getAllGatewayStoragePreferences.

/**
 * Fetch all Storage Resource Preferences of a registered gateway profile.
 *
 * @param gatewayID The identifier for the gateway profile to be requested
 * @return StoragePreference
 * Returns the StoragePreference object.
 */
@Override
public List<StoragePreference> getAllGatewayStoragePreferences(String gatewayID) throws RegistryServiceException, TException {
    try {
        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...");
        }
        appCatalog = RegistryFactory.getAppCatalog();
        GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
        return gatewayProfile.getGatewayProfile(gatewayID).getStoragePreferences();
    } catch (AppCatalogException e) {
        logger.error(gatewayID, "Error while reading gateway data storage preferences...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while reading gateway data storage preferences. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 78 with RegistryServiceException

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

the class RegistryServerHandler method addSSHForkJobSubmissionDetails.

/**
 * Add a SSH_FORK Job Submission details to a compute resource
 * App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
 *
 * @param computeResourceId The identifier of the compute resource to which JobSubmission protocol to be added
 * @param priorityOrder     Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
 * @param sshJobSubmission  The SSHJobSubmission object to be added to the resource.
 * @return status
 * Returns the unique job submission id.
 */
@Override
public String addSSHForkJobSubmissionDetails(String computeResourceId, int priorityOrder, SSHJobSubmission sshJobSubmission) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ComputeResource computeResource = appCatalog.getComputeResource();
        String submissionDetails = addJobSubmissionInterface(computeResource, computeResourceId, computeResource.addSSHJobSubmission(sshJobSubmission), JobSubmissionProtocol.SSH_FORK, priorityOrder);
        logger.debug("Airavata registered Fork job submission for compute resource id: " + computeResourceId);
        return submissionDetails;
    } catch (AppCatalogException e) {
        logger.error(computeResourceId, "Error while adding job submission interface to resource compute resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while adding job submission interface to resource compute resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 79 with RegistryServiceException

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

the class RegistryServerHandler method addSCPDataMovementDetails.

/**
 * Add a SCP data movement details to a compute resource
 * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
 *
 * productUri      The identifier of the compute resource to which JobSubmission protocol to be added
 * @param dmType
 * @param priorityOrder   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
 * @param scpDataMovement The SCPDataMovement object to be added to the resource.
 * @return status
 * Returns the unique job submission id.
 */
@Override
public String addSCPDataMovementDetails(String resourceId, DMType dmType, int priorityOrder, SCPDataMovement scpDataMovement) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ComputeResource computeResource = appCatalog.getComputeResource();
        String movementInterface = addDataMovementInterface(computeResource, resourceId, dmType, computeResource.addScpDataMovement(scpDataMovement), DataMovementProtocol.SCP, priorityOrder);
        logger.debug("Airavata registered SCP data movement for resource Id: " + resourceId);
        return movementInterface;
    } catch (AppCatalogException e) {
        logger.error(resourceId, "Error while adding data movement interface to resource compute resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while adding data movement interface to resource compute resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 80 with RegistryServiceException

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

the class RegistryServerHandler method updateSCPDataMovementDetails.

/**
 * Update the given scp data movement details
 * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
 *
 * @param dataMovementInterfaceId The identifier of the data movement Interface to be updated.
 * @param scpDataMovement         The SCPDataMovement object to be updated.
 * @return status
 * Returns a success/failure of the update.
 */
@Override
public boolean updateSCPDataMovementDetails(String dataMovementInterfaceId, SCPDataMovement scpDataMovement) throws RegistryServiceException, TException {
    try {
        ScpDataMovementResource movment = AppCatalogThriftConversion.getSCPDataMovementDescription(scpDataMovement);
        movment.setDataMovementInterfaceId(dataMovementInterfaceId);
        movment.save();
        logger.debug("Airavata updated SCP data movement with data movement id: " + dataMovementInterfaceId);
        return true;
    } catch (Exception e) {
        logger.error(dataMovementInterfaceId, "Error while adding job submission interface to resource compute resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while adding job submission interface to resource compute resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) TException(org.apache.thrift.TException) ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException)

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