Package org.nuxeo.ecm.core.blob
Interface KeyStrategy
-
- All Known Implementing Classes:
KeyStrategyDigest,KeyStrategyDocId,KeyStrategyManaged
public interface KeyStrategyDecides 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 interfaceKeyStrategy.WriteObserverObserver of the writes to anOutputStream.
-
Field Summary
Fields Modifier and Type Field Description static charVER_SEPSeparator 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 BlobWriteContextgetBlobWriteContext(BlobContext blobContext)Gets the write context for the given blob.StringgetDigestFromKey(String key)Gets, if possible, a digest from the key.default 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
-
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
-
-