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 
    Observer of the writes to an OutputStream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
    Separator between object key and version id in the returned key.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the write context for the given blob.
    Gets, if possible, a digest from the key.
    default boolean
    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_SEP
      Separator 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

      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