Package org.nuxeo.ecm.core.blob
Interface KeyStrategy
- All Known Implementing Classes:
KeyStrategyDigest
,KeyStrategyDocId
,KeyStrategyManaged
public interface KeyStrategy
Decides how a key is computed from a blob.
Implementations of this class must have a proper Object.equals(java.lang.Object)
method.
- Since:
- 11.1
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
Separator between object key and version id in the returned key. -
Method Summary
Modifier and TypeMethodDescriptiongetBlobWriteContext
(BlobContext blobContext) Gets the write context for the given blob.getDigestFromKey
(String key) Gets, if possible, a digest from the key.default boolean
isValidKey
(String key) Does the given key have the expected pattern for this strategy.boolean
Checks whether this key strategy uses de-duplication.
-
Field Details
-
VER_SEP
static final char VER_SEPSeparator between object key and version id in the returned key.- Since:
- 11.2
- See Also:
-
-
Method Details
-
useDeDuplication
boolean useDeDuplication()Checks whether this key strategy uses de-duplication. When de-duplication is used, two blobs with identical contents have identical keys. -
getDigestFromKey
Gets, if possible, a digest from the key. This is not possible if the key is not derived from a digest.- Parameters:
key
- the key- Returns:
- a digest, or
null
-
getBlobWriteContext
Gets the write context for the given blob. -
isValidKey
Does the given key have the expected pattern for this strategy.- Since:
- 2023.5
-