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)