use of org.apache.airavata.registry.core.app.catalog.resources.StorageInterfaceResource in project airavata by apache.
the class StorageResourceImpl method saveDataMovementInterfaces.
protected void saveDataMovementInterfaces(StorageResourceDescription description, StorageResourceResource storageResourceResource) throws AppCatalogException {
List<DataMovementInterface> dataMovemenetInterfaces = description.getDataMovementInterfaces();
if (dataMovemenetInterfaces != null && !dataMovemenetInterfaces.isEmpty()) {
for (DataMovementInterface dataMovementInterface : dataMovemenetInterfaces) {
StorageInterfaceResource storageInterface = AppCatalogThriftConversion.getStorageInterface(dataMovementInterface);
storageInterface.setStorageResourceResource(storageResourceResource);
storageInterface.setStorageResourceId(storageResourceResource.getStorageResourceId());
storageInterface.save();
}
}
}
use of org.apache.airavata.registry.core.app.catalog.resources.StorageInterfaceResource in project airavata by apache.
the class StorageResourceImpl method removeDataMovementInterface.
@Override
public void removeDataMovementInterface(String storageResourceId, String dataMovementInterfaceId) throws AppCatalogException {
try {
StorageInterfaceResource resource = new StorageInterfaceResource();
Map<String, String> ids = new HashMap<String, String>();
ids.put(AppCatAbstractResource.StorageInterfaceConstants.STORAGE_RESOURCE_ID, storageResourceId);
ids.put(AppCatAbstractResource.StorageInterfaceConstants.DATA_MOVEMENT_ID, dataMovementInterfaceId);
resource.remove(ids);
} catch (Exception e) {
logger.error("Error while removing data movement interface..", e);
throw new AppCatalogException(e);
}
}
Aggregations