use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.
the class RegistryServerHandler method deleteStorageResource.
/**
* Delete a Storage Resource.
*
* @param storageResourceId The identifier of the requested compute resource to be deleted.
* @return status
* Returns a success/failure of the deletion.
*/
@Override
public boolean deleteStorageResource(String storageResourceId) throws RegistryServiceException, TException {
try {
appCatalog = RegistryFactory.getAppCatalog();
appCatalog.getStorageResource().removeStorageResource(storageResourceId);
logger.debug("Airavata deleted storage resource with storage resource Id : " + storageResourceId);
return true;
} catch (AppCatalogException e) {
logger.error(storageResourceId, "Error while deleting storage resource...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while deleting 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 updateApplicationInterface.
/**
* Update a Application Interface.
*
* @param appInterfaceId The identifier of the requested application deployment to be updated.
* @param applicationInterface
* @return status
* Returns a success/failure of the update.
*/
@Override
public boolean updateApplicationInterface(String appInterfaceId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
try {
appCatalog = RegistryFactory.getAppCatalog();
appCatalog.getApplicationInterface().updateApplicationInterface(appInterfaceId, applicationInterface);
logger.debug("Airavata updated application interface with interface id : " + appInterfaceId);
return true;
} catch (AppCatalogException e) {
logger.error(appInterfaceId, "Error while updating application interface...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while updating application 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 updateUserResourceProfile.
/**
* Update a User Resource Profile.
*
* @param gatewayID The identifier for the requested gateway resource to be updated.
* @param userResourceProfile Gateway Resource Profile Object.
* @return status
* Returns a success/failure of the update.
*/
@Override
public boolean updateUserResourceProfile(String userId, String gatewayID, UserResourceProfile userResourceProfile) throws RegistryServiceException, TException {
try {
if (!ExpCatResourceUtils.isUserExist(userId, gatewayID)) {
logger.error("User does not exist.Please provide a valid user id...");
throw new RegistryServiceException("user does not exist.Please provide a valid user id...");
}
appCatalog = RegistryFactory.getAppCatalog();
UsrResourceProfile userProfile = appCatalog.getUserResourceProfile();
userProfile.updateUserResourceProfile(userId, gatewayID, userResourceProfile);
logger.debug("Airavata updated gateway profile with gateway id : " + userId);
return true;
} catch (AppCatalogException e) {
logger.error(gatewayID, "Error while updating gateway resource profile...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while updating gateway resource profile. More info : " + e.getMessage());
throw exception;
} catch (RegistryException e) {
logger.error(userId, "Error while retrieving user resource profile...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while retrieving user resource profile. More info : " + e.getMessage());
throw exception;
}
}
use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.
the class RegistryServerHandler method getSCPDataMovement.
/**
* This method returns SCP datamovement object
*
* @param dataMovementId The identifier of the datamovement Interface to be retrieved.
* @return SCPDataMovement instance
*/
@Override
public SCPDataMovement getSCPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
try {
appCatalog = RegistryFactory.getAppCatalog();
SCPDataMovement scpDataMovement = appCatalog.getComputeResource().getSCPDataMovement(dataMovementId);
logger.debug("Airavata retrieved SCP data movement with data movement id: " + dataMovementId);
return scpDataMovement;
} catch (AppCatalogException e) {
String errorMsg = "Error while retrieving SCP data movement interface to resource compute resource...";
logger.error(dataMovementId, errorMsg, e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage(errorMsg + e.getMessage());
throw exception;
}
}
use of org.apache.airavata.registry.api.exception.RegistryServiceException in project airavata by apache.
the class RegistryServerHandler method registerApplicationInterface.
/**
* Register a Application Interface.
*
* @param gatewayId
* @param applicationInterface Application Module Object created from the datamodel.
* @return appInterfaceId
* Returns a server-side generated airavata application interface globally unique identifier.
*/
@Override
public String registerApplicationInterface(String gatewayId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
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...");
}
try {
appCatalog = RegistryFactory.getAppCatalog();
String interfaceId = appCatalog.getApplicationInterface().addApplicationInterface(applicationInterface, gatewayId);
logger.debug("Airavata registered application interface for gateway id : " + gatewayId);
return interfaceId;
} catch (AppCatalogException e) {
logger.error("Error while adding application interface...", e);
RegistryServiceException exception = new RegistryServiceException();
exception.setMessage("Error while adding application interface. More info : " + e.getMessage());
throw exception;
}
}
Aggregations