Package org.nuxeo.ecm.core.blob
Class KeyStrategyDocId
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.KeyStrategyDocId
-
- All Implemented Interfaces:
KeyStrategy
public class KeyStrategyDocId extends Object implements KeyStrategy
Represents computation of blob keys based on the document id suffixed by the xpath if not the main blob.- Since:
- 11.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.blob.KeyStrategy
KeyStrategy.WriteObserver
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringMAIN_BLOB_XPATHprotected static PatternUUID_REGEX-
Fields inherited from interface org.nuxeo.ecm.core.blob.KeyStrategy
VER_SEP
-
-
Constructor Summary
Constructors Constructor Description KeyStrategyDocId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)BlobWriteContextgetBlobWriteContext(BlobContext blobContext)Gets the write context for the given blob.StringgetDigestFromKey(String key)Gets, if possible, a digest from the key.protected StringgetKey(BlobContext blobContext)inthashCode()static KeyStrategyDocIdinstance()booleanisValidKey(String key)Does the given key have the expected pattern for this strategy.booleanuseDeDuplication()Checks whether this key strategy uses de-duplication.
-
-
-
Field Detail
-
UUID_REGEX
protected static final Pattern UUID_REGEX
-
MAIN_BLOB_XPATH
protected static final String MAIN_BLOB_XPATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
instance
public static KeyStrategyDocId instance()
-
useDeDuplication
public boolean useDeDuplication()
Description copied from interface:KeyStrategyChecks whether this key strategy uses de-duplication. When de-duplication is used, two blobs with identical contents have identical keys.- Specified by:
useDeDuplicationin interfaceKeyStrategy
-
getDigestFromKey
public String getDigestFromKey(String key)
Description copied from interface:KeyStrategyGets, if possible, a digest from the key. This is not possible if the key is not derived from a digest.- Specified by:
getDigestFromKeyin interfaceKeyStrategy- Parameters:
key- the key- Returns:
- a digest, or
null
-
getBlobWriteContext
public BlobWriteContext getBlobWriteContext(BlobContext blobContext)
Description copied from interface:KeyStrategyGets the write context for the given blob.- Specified by:
getBlobWriteContextin interfaceKeyStrategy
-
getKey
protected String getKey(BlobContext blobContext)
-
isValidKey
public boolean isValidKey(String key)
Description copied from interface:KeyStrategyDoes the given key have the expected pattern for this strategy.- Specified by:
isValidKeyin interfaceKeyStrategy
-
-