Package ddf.catalog.content
Interface StorageProvider
public interface StorageProvider
Provider of content repository storage. All URIs should use the
ContentItem.CONTENT_SCHEME
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommit(StorageRequest id) Commit will be called by theCatalogFrameworkto finalize create, update, and delete requests.create(CreateStorageRequest createStorageRequest) Creates an item in the content repository.delete(DeleteStorageRequest deleteRequest) Deletes aContentItemfrom the content repository.read(ReadStorageRequest readRequest) Retrieves aContentItemfrom the content repository.voidRollback will be called by theCatalogFrameworkto discard changes related to create, update, and delete requestsupdate(UpdateStorageRequest updateStorageRequest) Updates aContentItemin the content repository.
-
Method Details
-
create
Creates an item in the content repository.- Parameters:
createStorageRequest- theCreateStorageRequestthat contains theContentItemto be stored/created in the content repository. The ID of theContentItemwill be auto-generated by the StorageProvider.- Returns:
- the
CreateStorageResponsethat contains theContentItemcreated by the StorageProvider in the content repository. ThisContentItemwill contain the GUID assigned by the StorageProvider. This GUID will be used in subsequentUpdateStorageRequest,ReadStorageRequest, andDeleteStorageRequestto access the storedContentItem. - Throws:
StorageException- if any problems encountered while creating/storing theContentItem
-
read
Retrieves aContentItemfrom the content repository.- Parameters:
readRequest- theReadStorageRequestthat contains the GUID of theContentItemto be retrieved- Returns:
- the
ReadStorageResponsethat contains theContentItemretrieved by the StorageProvider from the content repository. - Throws:
StorageException- if any problems encountered while retrieving theContentItem
-
update
Updates aContentItemin the content repository. TheContentItemmust already exist in the content repository in order to be updated. The StorageProvider will not automatically create theContentItemif it does not exist.- Parameters:
updateStorageRequest- theUpdateStorageRequestthat contains the GUID of theContentItemto be updated and theInputStreamwith the new data to overwrite the existingContentItemin the content repository.- Returns:
- the
UpdateStorageResponsethat contains theContentItemupdated by the StorageProvider in the content repository. - Throws:
StorageException- if any problems encountered while updating theContentItem
-
delete
Deletes aContentItemfrom the content repository.- Parameters:
deleteRequest- theDeleteStorageRequestthat contains the GUID of theContentItemto be deleted.- Returns:
- the
DeleteStorageResponsethat contains the status of the deletion of theContentItemfrom the content repository. - Throws:
StorageException- if any problems encountered while deleting theContentItem
-
commit
Commit will be called by theCatalogFrameworkto finalize create, update, and delete requests.- Parameters:
id- the id associated with the request- Throws:
StorageException
-
rollback
Rollback will be called by theCatalogFrameworkto discard changes related to create, update, and delete requests- Parameters:
id- the id associated with the request- Throws:
StorageException
-