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