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
FieldsModifier and TypeFieldDescriptionprotected FileDeprecated.Deprecated.protected FileStorageDeprecated.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_LENGTHFields inherited from interface org.nuxeo.ecm.core.blob.binary.BinaryManager
PROP_KEY, PROP_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.Closes the binary manager and releases all resources and temporary objects held by it.protected BinarygetBinary(InputStream in) Deprecated.Creates a binary value from the given input stream.Deprecated.Returns aBinarycorresponding to the given digest.Deprecated.Gets a file from cache or storage.voidinitialize(String blobProviderId, Map<String, String> properties) Deprecated.Initializes the binary manager.protected voidinitializeCache(File dir, long maxSize, long maxCount, long minAge, FileStorage fileStorage) Deprecated.Initialize the cache.voidinitializeCache(String maxSizeStr, String maxCountStr, String minAgeStr, FileStorage fileStorage) Deprecated.Initializes the cache.voidinitializeCache(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:BinaryManagerInitializes the binary manager.- Specified by:
initializein interfaceBinaryManager- Overrides:
initializein 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:BinaryManagerCloses the binary manager and releases all resources and temporary objects held by it. -
getBinary
Deprecated.Description copied from class:AbstractBinaryManagerCreates a binary value from the given input stream.- Specified by:
getBinaryin classAbstractBinaryManager- Throws:
IOException
-
getBinary
Deprecated.Description copied from interface:BinaryManagerReturns aBinarycorresponding to the given digest.A
nullis returned if the digest could not be found.- Specified by:
getBinaryin interfaceBinaryManager- Specified by:
getBinaryin classAbstractBinaryManager- Parameters:
digest- the digest, ornull- Returns:
- the corresponding binary
-
getFile
Deprecated.Gets a file from cache or storage.Used by
LazyBinary.- Throws:
IOException
-
CachingBlobStoreinstead