Search in sources :

Example 1 with StorageInterfaceResource

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();
        }
    }
}
Also used : DataMovementInterface(org.apache.airavata.model.data.movement.DataMovementInterface) StorageInterfaceResource(org.apache.airavata.registry.core.app.catalog.resources.StorageInterfaceResource)

Example 2 with StorageInterfaceResource

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);
    }
}
Also used : AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException) HashMap(java.util.HashMap) StorageInterfaceResource(org.apache.airavata.registry.core.app.catalog.resources.StorageInterfaceResource) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException)

Aggregations

StorageInterfaceResource (org.apache.airavata.registry.core.app.catalog.resources.StorageInterfaceResource)2 HashMap (java.util.HashMap)1 DataMovementInterface (org.apache.airavata.model.data.movement.DataMovementInterface)1 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)1