Package com.aquima.interactions.portal
Interface IChannelContentManager
- All Superinterfaces:
IContentManager
,IMovingContentManager
- All Known Implementing Classes:
DisposableChannelContentManager
,FileSystemContentManager
,MemoryContentManager
,PermanentChannelContentManager
An interface that can be used to perform basic CRUD operations for content.
- Since:
- 17.2
- Author:
- r.bissels
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ReadableByteChannel readableByteChannel, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user, String... roles) Add new content to the repository.getReadableByteChannel
(GUID id, IUserData user) Exposes a Channel for the Content ofid
.void
update
(GUID id, ReadableByteChannel readableByteChannel, String name, String contentType, IUserData user) Update existing content with new data, but keep the existing metadata.void
update
(GUID id, ReadableByteChannel readableByteChannel, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user) Update existing content with new data and metadata.Methods inherited from interface com.aquima.interactions.portal.IContentManager
create, delete, getDisposableContent, hasDisposableContent, isAuthorized, readBytes, readMetadata, readRoles, update, update, update, update
Methods inherited from interface com.aquima.interactions.portal.IMovingContentManager
canMove, getImplementation, move, notifyMove
-
Method Details
-
create
GUID create(ReadableByteChannel readableByteChannel, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user, String... roles) Add new content to the repository.- Parameters:
readableByteChannel
- The channel representing connection to the data, may not benull
.name
- A name for the content, may not benull
.contentType
- The content type of the data, may benull
ifunknown
.processId
- The id of the process where this content is part of, may benull
.caseId
- The id of the case where this content is part of, may benull
.properties
- Custom properties that should be stored with the content, may not benull
.user
- The user who is considered the creator of the content, may not benull
.roles
- The list of authorized roles associated to this content, may not benull
.- Returns:
- Returns a GUID that uniquely identifies the content, never
null
. - Throws:
CreateContentException
- If creation failed for any reason.
-
update
void update(GUID id, ReadableByteChannel readableByteChannel, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user) Update existing content with new data and metadata.- Parameters:
id
- The id of the content which should be updated, may not benull
.readableByteChannel
- The channel representing connection to the data, may not benull
.name
- A name for the content, may not benull
.contentType
- The content type of the new data, may benull
.processId
- The id of the case where this content is part of, may benull
.caseId
- The id of the case where this content is part of, may benull
.properties
- The new set of properties, this will completely overwrite the existing properties, may not benull
.user
- The user that is updating the content, may not benull
.- Throws:
UpdateContentException
- If the content can not be updated for any reason.ContentAuthorizationException
- If user is not authorized to access the content.
-
update
void update(GUID id, ReadableByteChannel readableByteChannel, String name, String contentType, IUserData user) Update existing content with new data, but keep the existing metadata.- Parameters:
id
- The id of the content which should be updated, may not benull
.readableByteChannel
- The channel representing connection to the data, may not benull
.name
- A name for the content, may not benull
.contentType
- The content type of the new data, may benull
.user
- The user that is updating the content, may not benull
.- Throws:
UpdateContentException
- If the content can not be updated for any reason.ContentAuthorizationException
- If user is not authorized to access the content.
-
getReadableByteChannel
Exposes a Channel for the Content ofid
. The caller of this method is responsible for closing the returned channel. If not closed it will acquire a shared (READ) FileLock in case of the FileSystemContentManager. If the user is not authorized it will throw an exception.- Parameters:
id
- The id of the content where a channel for is needed, may not benull
.user
- The user that is reading the content, may not benull
.- Returns:
- The total number of bytes read into the buffer, or
-1
if there is no more data because the end of the content has been reached. - Throws:
ContentAuthorizationException
- If user is not authorized to access the content.
-