Interface CacheBackend


public interface CacheBackend
Provides the cache primitives for a caching Persistence facade, suitable for multiple repositories. It is advisable to have one CacheBackend per Backend.
  • Field Details

    • NON_EXISTENT_REFERENCE_SENTINEL

      static final Reference NON_EXISTENT_REFERENCE_SENTINEL
      Special sentinel reference instance to indicate that a reference object has been marked as "not found". This object is only for cache-internal purposes.
    • NOT_FOUND_OBJ_SENTINEL

      static final Obj NOT_FOUND_OBJ_SENTINEL
      Special sentinel object instance to indicate that an object has been marked as "not found". This object is only for cache-internal purposes.
  • Method Details

    • get

      Obj get(@NonNull String realmId, @NonNull ObjRef id)
      Returns the Obj for the given id.
    • put

      void put(@NonNull String realmId, @NonNull Obj obj)
      Adds the given object to the local cache and sends a cache-invalidation message to Polaris peers.
    • putLocal

      void putLocal(@NonNull String realmId, @NonNull Obj obj)
      Adds the given object only to the local cache, does not send a cache-invalidation message.
    • putNegative

      void putNegative(@NonNull String realmId, @NonNull ObjRef id)
      Record the "not found" sentinel for the given id and type.
    • remove

      void remove(@NonNull String realmId, @NonNull ObjRef id)
    • clear

      void clear(@NonNull String realmId)
    • purge

      void purge()
    • estimatedSize

      long estimatedSize()
    • wrap

      Persistence wrap(@NonNull Persistence persist)
    • getReference

      Reference getReference(@NonNull String realmId, @NonNull String name)
    • removeReference

      void removeReference(@NonNull String realmId, @NonNull String name)
    • putReference

      void putReference(@NonNull String realmId, @NonNull Reference reference)
      Adds the given reference to the local cache and sends a cache-invalidation message to Polaris peers.
    • putReferenceLocal

      void putReferenceLocal(@NonNull String realmId, @NonNull Reference reference)
      Adds the given reference only to the local cache, does not send a cache-invalidation message.
    • putReferenceNegative

      void putReferenceNegative(@NonNull String realmId, @NonNull String name)