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
Nested Classes Modifier and Type Interface Description static interface
KeyStrategy.WriteObserver
Observer of the writes to anOutputStream
.
-
Field Summary
Fields Modifier and Type Field Description static char
VER_SEP
Separator between object key and version id in the returned key.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BlobWriteContext
getBlobWriteContext(BlobContext blobContext)
Gets the write context for the given blob.String
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
useDeDuplication()
Checks whether this key strategy uses de-duplication.
-
-
-
Field Detail
-
VER_SEP
static final char VER_SEP
Separator between object key and version id in the returned key.- Since:
- 11.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
String getDigestFromKey(String key)
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
BlobWriteContext getBlobWriteContext(BlobContext blobContext)
Gets the write context for the given blob.
-
isValidKey
default boolean isValidKey(String key)
Does the given key have the expected pattern for this strategy.- Since:
- 2023.5
-
-