Package org.nuxeo.ecm.core.blob
Class KeyStrategyDigest
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.KeyStrategyDigest
-
- All Implemented Interfaces:
KeyStrategy
public class KeyStrategyDigest extends Object implements KeyStrategy
Represents computation of blob keys based on a message digest.- Since:
- 11.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyStrategyDigest.WriteObserverDigest
Write observer computing a digest.-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.blob.KeyStrategy
KeyStrategy.WriteObserver
-
-
Field Summary
Fields Modifier and Type Field Description String
digestAlgorithm
Pattern
digestPattern
-
Fields inherited from interface org.nuxeo.ecm.core.blob.KeyStrategy
VER_SEP
-
-
Constructor Summary
Constructors Constructor Description KeyStrategyDigest(String digestAlgorithm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
BlobWriteContext
getBlobWriteContext(BlobContext blobContext)
Gets the write context for the given blob.String
getDigestFromKey(String key)
Gets, if possible, a digest from the key.protected static Pattern
getDigestPattern(String digestAlgorithm)
int
hashCode()
boolean
isValidDigest(String key)
boolean
isValidKey(String key)
Does the given key have the expected pattern for this strategy.boolean
useDeDuplication()
Checks whether this key strategy uses de-duplication.
-
-
-
Constructor Detail
-
KeyStrategyDigest
public KeyStrategyDigest(String digestAlgorithm)
-
-
Method Detail
-
useDeDuplication
public boolean useDeDuplication()
Description copied from interface:KeyStrategy
Checks whether this key strategy uses de-duplication. When de-duplication is used, two blobs with identical contents have identical keys.- Specified by:
useDeDuplication
in interfaceKeyStrategy
-
getDigestFromKey
public String getDigestFromKey(String key)
Description copied from interface:KeyStrategy
Gets, if possible, a digest from the key. This is not possible if the key is not derived from a digest.- Specified by:
getDigestFromKey
in interfaceKeyStrategy
- Parameters:
key
- the key- Returns:
- a digest, or
null
-
isValidDigest
public boolean isValidDigest(String key)
-
getBlobWriteContext
public BlobWriteContext getBlobWriteContext(BlobContext blobContext)
Description copied from interface:KeyStrategy
Gets the write context for the given blob.- Specified by:
getBlobWriteContext
in interfaceKeyStrategy
-
isValidKey
public boolean isValidKey(String key)
Description copied from interface:KeyStrategy
Does the given key have the expected pattern for this strategy.- Specified by:
isValidKey
in interfaceKeyStrategy
-
-