Package org.nuxeo.ecm.core.blob.binary
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.
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 Summary
Modifier and TypeFieldDescriptionprotected File
Deprecated.Deprecated.protected FileStorage
Deprecated.Fields inherited from class org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
blobProviderId, DEFAULT_DEPTH, DEFAULT_DIGEST, descriptor, digestPattern, DIGESTS_BY_LENGTH, garbageCollector, MAX_BUF_SIZE, MD5_DIGEST, MD5_DIGEST_LENGTH, MIN_BUF_SIZE, properties, SHA1_DIGEST, SHA1_DIGEST_LENGTH, SHA256_DIGEST, SHA256_DIGEST_LENGTH
Fields inherited from interface org.nuxeo.ecm.core.blob.binary.BinaryManager
PROP_KEY, PROP_PATH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Closes the binary manager and releases all resources and temporary objects held by it.protected Binary
getBinary
(InputStream in) Deprecated.Creates a binary value from the given input stream.Deprecated.Returns aBinary
corresponding to the given digest.Deprecated.Gets a file from cache or storage.void
initialize
(String blobProviderId, Map<String, String> properties) Deprecated.Initializes the binary manager.protected void
initializeCache
(File dir, long maxSize, long maxCount, long minAge, FileStorage fileStorage) Deprecated.Initialize the cache.void
initializeCache
(String maxSizeStr, String maxCountStr, String minAgeStr, FileStorage fileStorage) Deprecated.Initializes the cache.void
initializeCache
(String maxSizeStr, FileStorage fileStorage) Deprecated.Initialize the cache.Methods inherited from class org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
computeDigestPattern, getBinary, getDefaultDigestAlgorithm, getDescriptor, getDigestAlgorithm, getGarbageCollector, isValidDigest, removeBinaries, setDescriptor, storeAndDigest, toHexString
-
Field Details
-
cachedir
Deprecated. -
fileCache
Deprecated. -
fileStorage
Deprecated.
-
-
Constructor Details
-
CachingBinaryManager
public CachingBinaryManager()Deprecated.
-
-
Method Details
-
initialize
Deprecated.Description copied from interface:BinaryManager
Initializes the binary manager.- Specified by:
initialize
in interfaceBinaryManager
- Overrides:
initialize
in classAbstractBinaryManager
- Parameters:
blobProviderId
- the blob provider id for this binary managerproperties
- 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 filesmaxSize
- the maximum size of the cache (in bytes)maxCount
- the maximum number of files in the cacheminAge
- 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
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 cacheminAgeStr
- 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
Deprecated.Description copied from class:AbstractBinaryManager
Creates a binary value from the given input stream.- Specified by:
getBinary
in classAbstractBinaryManager
- Throws:
IOException
-
getBinary
Deprecated.Description copied from interface:BinaryManager
Returns aBinary
corresponding to the given digest.A
null
is returned if the digest could not be found.- Specified by:
getBinary
in interfaceBinaryManager
- Specified by:
getBinary
in classAbstractBinaryManager
- Parameters:
digest
- the digest, ornull
- Returns:
- the corresponding binary
-
getFile
Deprecated.Gets a file from cache or storage.Used by
LazyBinary
.- Throws:
IOException
-
CachingBlobStore
instead