Interface IChannelContentManager

All Superinterfaces:
IContentManager, IMovingContentManager
All Known Implementing Classes:
DisposableChannelContentManager, FileSystemContentManager, MemoryContentManager, PermanentChannelContentManager

public interface IChannelContentManager extends IContentManager
An interface that can be used to perform basic CRUD operations for content.
Since:
17.2
Author:
r.bissels
  • 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 be null.
      name - A name for the content, may not be null.
      contentType - The content type of the data, may be null if unknown.
      processId - The id of the process where this content is part of, may be null.
      caseId - The id of the case where this content is part of, may be null.
      properties - Custom properties that should be stored with the content, may not be null.
      user - The user who is considered the creator of the content, may not be null.
      roles - The list of authorized roles associated to this content, may not be null.
      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 be null.
      readableByteChannel - The channel representing connection to the data, may not be null.
      name - A name for the content, may not be null.
      contentType - The content type of the new data, may be null.
      processId - The id of the case where this content is part of, may be null.
      caseId - The id of the case where this content is part of, may be null.
      properties - The new set of properties, this will completely overwrite the existing properties, may not be null.
      user - The user that is updating the content, may not be null.
      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 be null.
      readableByteChannel - The channel representing connection to the data, may not be null.
      name - A name for the content, may not be null.
      contentType - The content type of the new data, may be null.
      user - The user that is updating the content, may not be null.
      Throws:
      UpdateContentException - If the content can not be updated for any reason.
      ContentAuthorizationException - If user is not authorized to access the content.
    • getReadableByteChannel

      ReadableByteChannel getReadableByteChannel(GUID id, IUserData user)
      Exposes a Channel for the Content of id. 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 be null.
      user - The user that is reading the content, may not be null.
      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.