Class ContentManagerDelegate

java.lang.Object
com.aquima.interactions.portal.content.ContentManagerDelegate
All Implemented Interfaces:
IContentManager
Direct Known Subclasses:
DisposableContentManager

public class ContentManagerDelegate extends Object implements IContentManager
An IContentManager implementation which delegates to another content manager.
Since:
11.0
Author:
Petru Galanton
  • Constructor Details

    • ContentManagerDelegate

      public ContentManagerDelegate(IContentManager delegate)
  • Method Details

    • create

      public GUID create(InputStream stream, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user, String... roles)
      Description copied from interface: IContentManager
      Add new content to the repository.
      Specified by:
      create in interface IContentManager
      Parameters:
      stream - The stream containing 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.
    • readBytes

      public int readBytes(GUID id, long position, byte[] buffer, int offset, int length, IUserData user)
      Description copied from interface: IContentManager
      Reads up to length bytes of data from content into a byte array. The method blocks until some input is available. Although publicly available, this method primarily facilitates the implementation of ContentInputStream. For reading content from an IContentManager, usage of ContentInputStream is recommended over direct usage of this method. If the user is not authorized it will throw an exception.
      Specified by:
      readBytes in interface IContentManager
      Parameters:
      id - The id of the content that should be read, may not be null.
      position - the start offset in the source content.
      buffer - The buffer into which the data is read, (may not be null.
      offset - The start offset in the destination array buffer.
      length - The maximum number of bytes read.
      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.
      See Also:
    • readMetadata

      public IContentMetadata readMetadata(GUID id, IUserData user, boolean checkRoles)
      Description copied from interface: IContentManager
      Reads only the meta data for a given content id.
      Specified by:
      readMetadata in interface IContentManager
      Parameters:
      id - The id of the content for which meta data is requested, may not be null.
      user - The user that is reading the content, may not be null.
      checkRoles - Flag indicating if the roles check should be done or not.
      Returns:
      Returns an IContentMetadataIContentMetadata object containing the requested meta data, never null.
    • readRoles

      public String[] readRoles(GUID id, IUserData user)
      Description copied from interface: IContentManager
      Reads the required roles for a given content id.
      Specified by:
      readRoles in interface IContentManager
      Parameters:
      id - The id of the content for which roles are requested, may not be null.
      user - The user that is reading the content, may not be null.
      Returns:
      Returns a list of required roles. Can be null.
    • update

      public void update(GUID id, String[] newRoles, IUserData user)
      Description copied from interface: IContentManager
      Update the existing content with new roles, but keep the existing data and metadata.
      Specified by:
      update in interface IContentManager
      Parameters:
      id - The id of the content which should be updated, may not be null.
      newRoles - The list of new roles. May not be null, may be empty.
      user - The user that is updating the content, may not be null.
    • update

      public void update(GUID id, InputStream stream, String name, String contentType, Long processId, String caseId, CustomContentProperties properties, IUserData user)
      Description copied from interface: IContentManager
      Update existing content with new data and metadata.
      Specified by:
      update in interface IContentManager
      Parameters:
      id - The id of the content which should be updated, may not be null.
      stream - The InputStream containing the new data, 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.
    • update

      public void update(GUID id, InputStream stream, String name, String contentType, IUserData user)
      Description copied from interface: IContentManager
      Update existing content with new data, but keep the existing metadata.
      Specified by:
      update in interface IContentManager
      Parameters:
      id - The id of the content which should be updated, may not be null.
      stream - The InputStream containing the new data, 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.
    • update

      public void update(GUID id, Long processId, String caseId, CustomContentProperties properties, IUserData user)
      Description copied from interface: IContentManager
      Update existing content with new metadata, but keep the existing data.
      Specified by:
      update in interface IContentManager
      Parameters:
      id - The id of the content which should be updated, may not be null.
      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 - 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.
    • delete

      public void delete(GUID id, IUserData user, boolean checkRoles)
      Description copied from interface: IContentManager
      Delete content from the repository
      Specified by:
      delete in interface IContentManager
      Parameters:
      id - The id of the content which should be deleted, may not be null.
      user - The user that is deleting the content, may not be null.
      checkRoles - Flag indicating if the roles check should be done or not.
    • isAuthorized

      public boolean isAuthorized(GUID id, IUserData user)
      Description copied from interface: IContentManager
      This method checks if the user has roles on this content with the given id.
      Specified by:
      isAuthorized in interface IContentManager
      Parameters:
      id - The id of the content, never null.
      user - The details of the user that wants to access the content, never null.
      Returns:
      A flag indicating if the user has roles on the document or not.
    • hasDisposableContent

      public boolean hasDisposableContent()
      Description copied from interface: IContentManager
      This method checks if the current content manager has any IDisposableContent contents.
      Specified by:
      hasDisposableContent in interface IContentManager
      Returns:
      A flag indicating whether the content manager has disposable content objects.
    • getDisposableContent

      public IDisposableContent getDisposableContent()
      Description copied from interface: IContentManager
      This method returns the content manager's disposable content.
      Specified by:
      getDisposableContent in interface IContentManager
    • getDelegate

      protected IContentManager getDelegate()