Search in sources :

Example 56 with RegistryServiceException

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

the class RegistryServerHandler method deleteJobSubmissionInterface.

/**
 * Delete a given job submisison interface
 *
 * @param computeResourceId
 * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be changed
 * @return status
 * Returns a success/failure of the deletion.
 */
@Override
public boolean deleteJobSubmissionInterface(String computeResourceId, String jobSubmissionInterfaceId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        appCatalog.getComputeResource().removeJobSubmissionInterface(computeResourceId, jobSubmissionInterfaceId);
        logger.debug("Airavata deleted job submission interface with interface id : " + jobSubmissionInterfaceId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(jobSubmissionInterfaceId, "Error while deleting job submission interface...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while deleting job submission interface. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 57 with RegistryServiceException

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

the class RegistryServerHandler method getExperimentOutputs.

/**
 * Get Experiment Outputs
 * This method to be used when need to obtain final outputs of a certain Experiment
 *
 * @param airavataExperimentId Experiment ID of the experimnet you need the outputs.
 * @return list
 * List of experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
 */
@Override
public List<OutputDataObjectType> getExperimentOutputs(String airavataExperimentId) throws RegistryServiceException, TException {
    try {
        experimentCatalog = RegistryFactory.getDefaultExpCatalog();
        if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)) {
            logger.error(airavataExperimentId, "Get experiment outputs failed, experiment {} doesn't exit.", airavataExperimentId);
            throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
        }
        logger.debug("Airavata retrieved experiment outputs for experiment id : " + airavataExperimentId);
        return (List<OutputDataObjectType>) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT_OUTPUT, airavataExperimentId);
    } catch (Exception e) {
        logger.error(airavataExperimentId, "Error while retrieving the experiment outputs", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving the experiment outputs. 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 58 with RegistryServiceException

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

the class RegistryServerHandler method getAllStorageResourceNames.

/**
 * Fetch all registered Storage Resources.
 *
 * @return A map of registered compute resource id's and thier corresponding hostnames.
 * Compute Resource Object created from the datamodel..
 */
@Override
public Map<String, String> getAllStorageResourceNames() throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        Map<String, String> resourceIdList = appCatalog.getStorageResource().getAllStorageResourceIdList();
        logger.debug("Airavata retrieved storage resources list...");
        return resourceIdList;
    } catch (AppCatalogException e) {
        logger.error("Error while retrieving storage resource...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while retrieving storage resource. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 59 with RegistryServiceException

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

the class RegistryServerHandler method deleteApplicationDeployment.

/**
 * Delete an Application Deployment.
 *
 * @param appDeploymentId The unique identifier of application deployment to be deleted.
 * @return status
 * Returns a success/failure of the deletion.
 */
@Override
public boolean deleteApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
    try {
        appCatalog = RegistryFactory.getAppCatalog();
        appCatalog.getApplicationDeployment().removeAppDeployment(appDeploymentId);
        logger.debug("Airavata removed application deployment with deployment id : " + appDeploymentId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(appDeploymentId, "Error while deleting application deployment...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while deleting application deployment. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException)

Example 60 with RegistryServiceException

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

the class RegistryServerHandler method addGatewayStoragePreference.

/**
 * Add a Storage Resource Preference to a registered gateway profile.
 *
 * @param gatewayID         The identifier of the gateway profile to be added.
 * @param storageResourceId Preferences related to a particular compute resource
 * @param dataStoragePreference
 * @return status
 * Returns a success/failure of the addition. If a profile already exists, this operation will fail.
 * Instead an update should be used.
 */
@Override
public boolean addGatewayStoragePreference(String gatewayID, String storageResourceId, StoragePreference dataStoragePreference) 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();
        if (!gatewayProfile.isGatewayResourceProfileExists(gatewayID)) {
            throw new RegistryServiceException("Gateway resource profile '" + gatewayID + "' does not exist!!!");
        }
        GatewayResourceProfile profile = gatewayProfile.getGatewayProfile(gatewayID);
        // gatewayProfile.removeGatewayResourceProfile(gatewayID);
        dataStoragePreference.setStorageResourceId(storageResourceId);
        profile.addToStoragePreferences(dataStoragePreference);
        gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
        logger.debug("Airavata added storage resource preference with gateway id : " + gatewayID + " and for storage resource id : " + storageResourceId);
        return true;
    } catch (AppCatalogException e) {
        logger.error(gatewayID, "Error while registering gateway resource profile preference...", e);
        RegistryServiceException exception = new RegistryServiceException();
        exception.setMessage("Error while registering gateway resource profile preference. More info : " + e.getMessage());
        throw exception;
    }
}
Also used : RegistryServiceException(org.apache.airavata.registry.api.exception.RegistryServiceException) GatewayResourceProfile(org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile)

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