Class NonChannelTestFileSystemContentManager

java.lang.Object
com.aquima.interactions.test.content.NonChannelTestFileSystemContentManager
All Implemented Interfaces:
com.aquima.interactions.portal.IContentManager, com.aquima.interactions.portal.IMovingContentManager

public class NonChannelTestFileSystemContentManager extends Object implements com.aquima.interactions.portal.IContentManager
A manager of content on a file system.

Path / File name generation is delegated to an instance of IFileSystemNamingStrategy.

This manager creates two files for snippet of content that is managed:

  • a file that contains the content;
  • another file that contains the meta-data related to the content. meta-data file also contains the roles acquired by the content.
The path identifier for both of these files (as generated by the namingStrategy) is equal, but applied to a different root/base path: Content is stored in files that are relative to the path segment as identified by "DATA", where meta-data is stored relative to "METADATA".

This implementation does not explicitly store the file size in the metadata. Instead, whenever a metadata-representation is constructed, the instance is complemented with file size information that is obtained from the filesystem directly.

Since:
9.3
Author:
G. der Kinderen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Metadata representation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The identifier of the path segment that is prepended to all files that contain the (raw) content.
    static final String
    The identifier of the path segment that is prepended to all files that contain metadata.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection)
    Constructs a new manager, using a default naming strategy.
    NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection, com.aquima.interactions.portal.content.filesystem.IFileSystemNamingStrategy namingStrategy, com.aquima.interactions.portal.content.FileRoleCache roleCache)
    Constructs a new manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    com.aquima.interactions.foundation.GUID
    create(InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user, String... roles)
    Deprecated.
    void
    delete(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles)
     
    com.aquima.interactions.portal.IDisposableContent
     
    com.aquima.interactions.portal.IMovingContentManager
     
    boolean
     
    boolean
    isAuthorized(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user)
     
    com.aquima.interactions.foundation.GUID
    move(com.aquima.interactions.foundation.GUID fileId, com.aquima.interactions.portal.IContentManager targetContentManager, com.aquima.interactions.project.IUserData user)
     
    void
    notifyMove(com.aquima.interactions.foundation.GUID id)
     
    int
    readBytes(com.aquima.interactions.foundation.GUID id, long position, byte[] buffer, int offset, int length, com.aquima.interactions.project.IUserData user)
    Deprecated.
    com.aquima.interactions.portal.IContentMetadata
    readMetadata(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles)
     
    readRoles(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user)
     
    protected String
    toContentPath(com.aquima.interactions.foundation.GUID guid)
    Calculates the file system path in which content is stored that is identified by the provided identifier.
    protected String
    toMetadataPath(com.aquima.interactions.foundation.GUID guid)
    Calculates the file system path in which metadata is stored for content identified by the provided identifier.
    void
    update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, com.aquima.interactions.project.IUserData user)
    Deprecated.
    void
    update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user)
    Deprecated.
    void
    update(com.aquima.interactions.foundation.GUID id, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user)
     
    void
    update(com.aquima.interactions.foundation.GUID id, String[] newRoles, com.aquima.interactions.project.IUserData user)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONTENT_PATHSEGMENT

      public static final String CONTENT_PATHSEGMENT
      The identifier of the path segment that is prepended to all files that contain the (raw) content.
      See Also:
    • METADATA_PATHSEGMENT

      public static final String METADATA_PATHSEGMENT
      The identifier of the path segment that is prepended to all files that contain metadata.
      See Also:
  • Constructor Details

    • NonChannelTestFileSystemContentManager

      public NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection)
      Constructs a new manager, using a default naming strategy.
      Parameters:
      connection - The connection providing access to the content store (cannot be null).
      Since:
      9.3
    • NonChannelTestFileSystemContentManager

      public NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection, com.aquima.interactions.portal.content.filesystem.IFileSystemNamingStrategy namingStrategy, com.aquima.interactions.portal.content.FileRoleCache roleCache)
      Constructs a new manager.
      Parameters:
      connection - The connection providing access to the content store (cannot be null).
      namingStrategy - a path/name converter (cannot be null).
      Since:
      9.3
  • Method Details

    • create

      @Deprecated public com.aquima.interactions.foundation.GUID create(InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user, String... roles)
      Deprecated.
      Specified by:
      create in interface com.aquima.interactions.portal.IContentManager
    • readMetadata

      public com.aquima.interactions.portal.IContentMetadata readMetadata(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles)
      Specified by:
      readMetadata in interface com.aquima.interactions.portal.IContentManager
    • readRoles

      public String[] readRoles(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user)
      Specified by:
      readRoles in interface com.aquima.interactions.portal.IContentManager
    • update

      public void update(com.aquima.interactions.foundation.GUID id, String[] newRoles, com.aquima.interactions.project.IUserData user)
      Specified by:
      update in interface com.aquima.interactions.portal.IContentManager
    • update

      @Deprecated public void update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user)
      Deprecated.
      Specified by:
      update in interface com.aquima.interactions.portal.IContentManager
    • update

      @Deprecated public void update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, com.aquima.interactions.project.IUserData user)
      Deprecated.
      Specified by:
      update in interface com.aquima.interactions.portal.IContentManager
    • update

      public void update(com.aquima.interactions.foundation.GUID id, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user)
      Specified by:
      update in interface com.aquima.interactions.portal.IContentManager
    • getImplementation

      public com.aquima.interactions.portal.IMovingContentManager getImplementation()
      Specified by:
      getImplementation in interface com.aquima.interactions.portal.IMovingContentManager
    • move

      public com.aquima.interactions.foundation.GUID move(com.aquima.interactions.foundation.GUID fileId, com.aquima.interactions.portal.IContentManager targetContentManager, com.aquima.interactions.project.IUserData user)
      Specified by:
      move in interface com.aquima.interactions.portal.IMovingContentManager
    • notifyMove

      public void notifyMove(com.aquima.interactions.foundation.GUID id)
      Specified by:
      notifyMove in interface com.aquima.interactions.portal.IMovingContentManager
    • canMove

      public boolean canMove()
      Specified by:
      canMove in interface com.aquima.interactions.portal.IMovingContentManager
    • delete

      public void delete(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles)
      Specified by:
      delete in interface com.aquima.interactions.portal.IContentManager
    • isAuthorized

      public boolean isAuthorized(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user)
      Specified by:
      isAuthorized in interface com.aquima.interactions.portal.IContentManager
    • readBytes

      @Deprecated public int readBytes(com.aquima.interactions.foundation.GUID id, long position, byte[] buffer, int offset, int length, com.aquima.interactions.project.IUserData user)
      Deprecated.
      Specified by:
      readBytes in interface com.aquima.interactions.portal.IContentManager
    • hasDisposableContent

      public boolean hasDisposableContent()
      Specified by:
      hasDisposableContent in interface com.aquima.interactions.portal.IContentManager
    • getDisposableContent

      public com.aquima.interactions.portal.IDisposableContent getDisposableContent()
      Specified by:
      getDisposableContent in interface com.aquima.interactions.portal.IContentManager
    • toMetadataPath

      protected String toMetadataPath(com.aquima.interactions.foundation.GUID guid)
      Calculates the file system path in which metadata is stored for content identified by the provided identifier.

      The path that is returned will:

      • reference a file (as opposed to a directory)
      • not start with a file name-separator
      This method uses system-dependent default name-separators, but complements paths as returned by the namingStrategy.

      @param GUID content identifier (cannot be null).

      Returns:
      A (relative) path (never null).
    • toContentPath

      protected String toContentPath(com.aquima.interactions.foundation.GUID guid)
      Calculates the file system path in which content is stored that is identified by the provided identifier.

      The path that is returned will:

      • reference a file (as opposed to a directory)
      • not start with a file name-separator
      This method uses system-dependent default name-separators, but complements paths as returned by the namingStrategy.

      @param GUID content identifier (cannot be null).

      Returns:
      A (relative) path (never null).