use of org.apache.airavata.registry.cpi.AppCatalogException in project airavata by apache.
the class ComputeResourceImpl method removeDataMovementInterface.
@Override
public void removeDataMovementInterface(String computeResourceId, String dataMovementInterfaceId) throws AppCatalogException {
try {
DataMovementInterfaceResource resource = new DataMovementInterfaceResource();
Map<String, String> ids = new HashMap<String, String>();
ids.put(AppCatAbstractResource.DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID, computeResourceId);
ids.put(AppCatAbstractResource.DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID, dataMovementInterfaceId);
resource.remove(ids);
} catch (Exception e) {
logger.error("Error while removing data movement interface..", e);
throw new AppCatalogException(e);
}
}
use of org.apache.airavata.registry.cpi.AppCatalogException in project airavata by apache.
the class ComputeResourceImpl method addSSHJobSubmission.
@Override
public String addSSHJobSubmission(SSHJobSubmission sshJobSubmission) throws AppCatalogException {
try {
String submissionId = AppCatalogUtils.getID("SSH");
sshJobSubmission.setJobSubmissionInterfaceId(submissionId);
String resourceJobManagerId = addResourceJobManager(sshJobSubmission.getResourceJobManager());
SshJobSubmissionResource resource = AppCatalogThriftConversion.getSSHJobSubmission(sshJobSubmission);
resource.setResourceJobManagerId(resourceJobManagerId);
resource.getResourceJobManagerResource().setResourceJobManagerId(resourceJobManagerId);
if (sshJobSubmission.getMonitorMode() != null) {
resource.setMonitorMode(sshJobSubmission.getMonitorMode().toString());
}
resource.save();
return submissionId;
} catch (Exception e) {
logger.error("Error while saving SSH Job Submission...", e);
throw new AppCatalogException(e);
}
}
use of org.apache.airavata.registry.cpi.AppCatalogException in project airavata by apache.
the class ComputeResourceImpl method addDataMovementProtocol.
@Override
public String addDataMovementProtocol(String resourceId, DMType dmType, DataMovementInterface dataMovementInterface) throws AppCatalogException {
try {
String dmId = null;
if (dmType.equals(DMType.COMPUTE_RESOURCE)) {
DataMovementInterfaceResource dmi = AppCatalogThriftConversion.getDataMovementInterfaceResource(dataMovementInterface);
dmi.setComputeResourceId(resourceId);
ComputeResourceResource computeResourceResource = new ComputeResourceResource();
computeResourceResource = (ComputeResourceResource) computeResourceResource.get(resourceId);
dmi.setComputeHostResource(computeResourceResource);
dmi.save();
dmId = dmi.getDataMovementInterfaceId();
} else if (dmType.equals(DMType.STORAGE_RESOURCE)) {
StorageInterfaceResource storageInterface = AppCatalogThriftConversion.getStorageInterface(dataMovementInterface);
storageInterface.setStorageResourceId(resourceId);
StorageResourceResource storageResourceResource = new StorageResourceResource();
storageResourceResource = (StorageResourceResource) storageResourceResource.get(resourceId);
storageInterface.setStorageResourceResource(storageResourceResource);
storageInterface.save();
dmId = storageInterface.getDataMovementInterfaceId();
}
return dmId;
} catch (Exception e) {
logger.error("Error while saving " + dataMovementInterface.getDataMovementProtocol().toString() + " data movement Protocol...", e);
throw new AppCatalogException(e);
}
}
use of org.apache.airavata.registry.cpi.AppCatalogException in project airavata by apache.
the class ComputeResourceImpl method getResourceJobManager.
@Override
public ResourceJobManager getResourceJobManager(String resourceJobManagerId) throws AppCatalogException {
try {
ResourceJobManagerResource resource = new ResourceJobManagerResource();
ResourceJobManagerResource jobManagerResource = (ResourceJobManagerResource) resource.get(resourceJobManagerId);
return AppCatalogThriftConversion.getResourceJobManager(jobManagerResource);
} catch (Exception e) {
logger.error("Error while retrieving resource job manager..", e);
throw new AppCatalogException(e);
}
}
use of org.apache.airavata.registry.cpi.AppCatalogException in project airavata by apache.
the class ComputeResourceImpl method getUNICOREDataMovement.
@Override
public UnicoreDataMovement getUNICOREDataMovement(String dataMovementId) throws AppCatalogException {
try {
UnicoreDataMovementResource resource = new UnicoreDataMovementResource();
resource = (UnicoreDataMovementResource) resource.get(dataMovementId);
return AppCatalogThriftConversion.getUnicoreDMDescription(resource);
} catch (Exception e) {
logger.error("Error while retrieving UNICORE data movement...", e);
throw new AppCatalogException(e);
}
}
Aggregations