Interface DatabaseBackedContentManager

All Known Implementing Classes:
NoopDatabaseBackedContentManager

public interface DatabaseBackedContentManager
Controls selecting and processing content for storage in the database.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    postRetrieve(String path, byte[] bytes)
    Process the content after it is retrieved from the database.
    byte[]
    preStore(String path, byte[] bytes)
    Process the content before it is stored in the database.
    boolean
    test(String path)
    Test if the content at the given path should be stored in the database.
  • Method Details

    • test

      boolean test(String path)
      Test if the content at the given path should be stored in the database.
      Parameters:
      path - the path of the content relative to the root of store
      Returns:
      true if the content should be stored in the database, false otherwise
    • preStore

      byte[] preStore(String path, byte[] bytes)
      Process the content before it is stored in the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as in postRetrieve(String, byte[])

      The most important use case for this method is to compress the content before it is stored in the database.

      Parameters:
      path - the path of the content relative to the root of store
      bytes - the content to be stored
      Returns:
      the processed content
    • postRetrieve

      byte[] postRetrieve(String path, byte[] bytes)
      Process the content after it is retrieved from the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as in preStore(String, byte[])

      The most important use case for this method is to decompress the content after it is retrieved from the database (assuming it was compressed before it was stored).

      Parameters:
      path - the path of the content relative to the root of store
      bytes - the content to be processed
      Returns:
      the processed content