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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
Aggregations