Search in sources :

Example 86 with RegistryServiceException

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

the class RegistryServerHandler method getApplicationDeployment.

/**
 * Fetch a Application Deployment.
 *
 * @param appDeploymentId The identifier for the requested application module
 * @return applicationDeployment
 * Returns a application Deployment Object.
 */
@Override
public ApplicationDeploymentDescription getApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ApplicationDeploymentDescription deployement = appCatalog.getApplicationDeployment().getApplicationDeployement(appDeploymentId);
        logger.debug("Airavata registered application deployment for deployment id : " + appDeploymentId);
        return deployement;
    } catch (AppCatalogException e) {
        logger.error(appDeploymentId, "Error while retrieving application deployment...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving application deployment. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 87 with RegistryServiceException

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

the class RegistryServerHandler method getComputeResource.

/**
 * Fetch the given Compute Resource.
 *
 * @param computeResourceId The identifier for the requested compute resource
 * @return computeResourceDescription
 * Compute Resource Object created from the datamodel..
 */
@Override
public ComputeResourceDescription getComputeResource(String computeResourceId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ComputeResourceDescription computeResource = appCatalog.getComputeResource().getComputeResource(computeResourceId);
        logger.debug("Airavata retrieved compute resource with compute resource Id : " + computeResourceId);
        return computeResource;
    } catch (AppCatalogException e) {
        logger.error(computeResourceId, "Error while retrieving compute resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving compute resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 88 with RegistryServiceException

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

the class RegistryServerHandler method updateLocalSubmissionDetails.

/**
 * Update the given Local Job Submission details
 *
 * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be updated.
 * @param localSubmission          The LOCALSubmission object to be updated.
 * @return status
 * Returns a success/failure of the deletion.
 */
@Override
public boolean updateLocalSubmissionDetails(String jobSubmissionInterfaceId, LOCALSubmission localSubmission) throws RegistryServiceException, TException {
    try {
        LocalSubmissionResource submission = AppCatalogThriftConversion.getLocalJobSubmission(localSubmission);
        submission.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
        submission.save();
        logger.debug("Airavata updated local job submission for job submission interface id: " + jobSubmissionInterfaceId);
        return true;
    } catch (Exception e) {
        logger.error(jobSubmissionInterfaceId, "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)

Example 89 with RegistryServiceException

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

the class RegistryServerHandler method registerStorageResource.

/**
 * Register a Storage Resource.
 *
 * @param storageResourceDescription Storge Resource Object created from the datamodel.
 * @return storageResourceId
 * Returns a server-side generated airavata storage resource globally unique identifier.
 */
@Override
public String registerStorageResource(StorageResourceDescription storageResourceDescription) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        String storageResource = appCatalog.getStorageResource().addStorageResource(storageResourceDescription);
        logger.debug("Airavata registered storage resource with storage resource Id : " + storageResource);
        return storageResource;
    } catch (AppCatalogException e) {
        logger.error("Error while saving storage resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while saving storage resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 90 with RegistryServiceException

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

the class RegistryServerHandler method getApplicationInterface.

/**
 * Fetch an Application Interface.
 *
 * @param appInterfaceId The identifier for the requested application interface.
 * @return applicationInterface
 * Returns an application Interface Object.
 */
@Override
public ApplicationInterfaceDescription getApplicationInterface(String appInterfaceId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        ApplicationInterfaceDescription interfaceDescription = appCatalog.getApplicationInterface().getApplicationInterface(appInterfaceId);
        logger.debug("Airavata retrieved application interface with interface id : " + appInterfaceId);
        return interfaceDescription;
    } catch (AppCatalogException e) {
        logger.error(appInterfaceId, "Error while retrieving application interface...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving application interface. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) ApplicationInterfaceDescription(org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription)

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