Class CachingBinaryManager

java.lang.Object
org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
org.nuxeo.ecm.core.blob.binary.CachingBinaryManager
All Implemented Interfaces:
BinaryManager
Direct Known Subclasses:
AbstractCloudBinaryManager

@Deprecated(since="2023.9") public abstract class CachingBinaryManager extends AbstractBinaryManager
Deprecated.
since 2023.9, use CachingBlobStore instead
Abstract class for a BinaryManager that uses a cache for its files because fetching them is expensive.

Initialization of the BinaryManager must call initializeCache(java.io.File, long, long, long, org.nuxeo.ecm.core.blob.binary.FileStorage) from the initialize(java.lang.String, java.util.Map<java.lang.String, java.lang.String>) method.

Since:
5.7
  • Field Details

    • cachedir

      protected File cachedir
      Deprecated.
    • fileCache

      public FileCache fileCache
      Deprecated.
    • fileStorage

      protected FileStorage fileStorage
      Deprecated.
  • Constructor Details

    • CachingBinaryManager

      public CachingBinaryManager()
      Deprecated.
  • Method Details

    • initialize

      public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
      Deprecated.
      Description copied from interface: BinaryManager
      Initializes the binary manager.
      Specified by:
      initialize in interface BinaryManager
      Overrides:
      initialize in class AbstractBinaryManager
      Parameters:
      blobProviderId - the blob provider id for this binary manager
      properties - initialization properties
      Throws:
      IOException
    • initializeCache

      protected void initializeCache(File dir, long maxSize, long maxCount, long minAge, FileStorage fileStorage)
      Deprecated.
      Initialize the cache.
      Parameters:
      dir - the directory to use to store cached files
      maxSize - the maximum size of the cache (in bytes)
      maxCount - the maximum number of files in the cache
      minAge - the minimum age of a file in the cache to be eligible for removal (in seconds)
      fileStorage - the file storage mechanism to use to store and fetch files
      Since:
      5.9.2
    • initializeCache

      public void initializeCache(String maxSizeStr, FileStorage fileStorage) throws IOException
      Deprecated.
      Initialize the cache.
      Parameters:
      maxSizeStr - the maximum size of the cache (as a String)
      fileStorage - the file storage mechanism to use to store and fetch files
      Throws:
      IOException
      Since:
      6.0
      See Also:
    • initializeCache

      public void initializeCache(String maxSizeStr, String maxCountStr, String minAgeStr, FileStorage fileStorage) throws IOException
      Deprecated.
      Initializes the cache.
      Parameters:
      maxSizeStr - the maximum size of the cache (as a String)
      maxCountStr - the maximum number of files in the cache
      minAgeStr - the minimum age of a file in the cache to be eligible for removal (in seconds)
      fileStorage - the file storage mechanism to use to store and fetch files
      Throws:
      IOException
      Since:
      7.10-HF03, 8.1
      See Also:
    • close

      public void close()
      Deprecated.
      Description copied from interface: BinaryManager
      Closes the binary manager and releases all resources and temporary objects held by it.
    • getBinary

      protected Binary getBinary(InputStream in) throws IOException
      Deprecated.
      Description copied from class: AbstractBinaryManager
      Creates a binary value from the given input stream.
      Specified by:
      getBinary in class AbstractBinaryManager
      Throws:
      IOException
    • getBinary

      public Binary getBinary(String digest)
      Deprecated.
      Description copied from interface: BinaryManager
      Returns a Binary corresponding to the given digest.

      A null is returned if the digest could not be found.

      Specified by:
      getBinary in interface BinaryManager
      Specified by:
      getBinary in class AbstractBinaryManager
      Parameters:
      digest - the digest, or null
      Returns:
      the corresponding binary
    • getFile

      public File getFile(String digest) throws IOException
      Deprecated.
      Gets a file from cache or storage.

      Used by LazyBinary.

      Throws:
      IOException