Class DBSCachingRepository

java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSCachingRepository
All Implemented Interfaces:
LockManager, Repository, DBSRepository

public class DBSCachingRepository extends Object implements DBSRepository
The DBS Cache layer used to cache some method call of real repository
Since:
8.10
  • Field Details

  • Constructor Details

  • Method Details

    • getCache

      protected com.google.common.cache.Cache<String,State> getCache()
    • getChildCache

      protected com.google.common.cache.Cache<String,String> getChildCache()
    • getInvalidationsPropagator

      protected DBSInvalidationsPropagator getInvalidationsPropagator()
    • getClusterInvalidator

      protected DBSClusterInvalidator getClusterInvalidator()
    • newCache

      protected com.google.common.cache.Cache<String,State> newCache(boolean metrics)
    • newChildCache

      protected com.google.common.cache.Cache<String,String> newChildCache(boolean metrics)
    • removeCacheMetrics

      protected void removeCacheMetrics()
    • newCache

      protected <T> com.google.common.cache.Cache<String,T> newCache(DBSRepositoryDescriptor descriptor)
    • initInvalidationsPropagator

      protected DBSInvalidationsPropagator initInvalidationsPropagator()
      Invalidations need to be propagated between connection caches only if there is such a cache, which is the case only if transactions are used.
    • initClusterInvalidator

      protected DBSClusterInvalidator initClusterInvalidator(DBSRepositoryDescriptor descriptor)
    • createClusterInvalidator

      protected DBSClusterInvalidator createClusterInvalidator(DBSRepositoryDescriptor descriptor)
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface Repository
    • getConnection

      public DBSConnection getConnection()
      Description copied from interface: DBSRepository
      Gets a new connection to this repository.
      Specified by:
      getConnection in interface DBSRepository
      Returns:
      a new connection
    • supportsTransactions

      public boolean supportsTransactions()
      Description copied from interface: DBSRepository
      Checks whether this repository supports transactions.
      Specified by:
      supportsTransactions in interface DBSRepository
      Returns:
      true if the repository supports transactions
      See Also:
    • getBlobManager

      public BlobManager getBlobManager()
      Description copied from interface: DBSRepository
      Gets the blob manager.
      Specified by:
      getBlobManager in interface DBSRepository
      Returns:
      the blob manager.
    • getFulltextConfiguration

      public FulltextConfiguration getFulltextConfiguration()
      Description copied from interface: Repository
      Gets the fulltext configuration for this repository.
      Specified by:
      getFulltextConfiguration in interface Repository
    • isFulltextDisabled

      public boolean isFulltextDisabled()
      Description copied from interface: DBSRepository
      Checks if fulltext indexing (and search) is disabled.
      Specified by:
      isFulltextDisabled in interface DBSRepository
      Returns:
      true if fulltext indexing is disabled, false if it is enabled
    • isFulltextStoredInBlob

      public boolean isFulltextStoredInBlob()
      Description copied from interface: DBSRepository
      Checks if fulltext is stored in a blob.
      Specified by:
      isFulltextStoredInBlob in interface DBSRepository
      Returns:
      true if fulltext is stored in a blob, false if it is stored as a regular string
    • isFulltextSearchDisabled

      public boolean isFulltextSearchDisabled()
      Description copied from interface: DBSRepository
      Checks if fulltext search is disabled.
      Specified by:
      isFulltextSearchDisabled in interface DBSRepository
      Returns:
      true if fulltext search is disabled, false if it is enabled
    • isChangeTokenEnabled

      public boolean isChangeTokenEnabled()
      Description copied from interface: DBSRepository
      Checks if database-managed document change tokens are enabled.
      Specified by:
      isChangeTokenEnabled in interface DBSRepository
      Returns:
      true if the database maintains document change tokens
    • getLockManager

      public LockManager getLockManager()
      Description copied from interface: DBSRepository
      Gets the lock manager for this repository.
      Specified by:
      getLockManager in interface DBSRepository
      Returns:
      the lock manager
    • getLock

      public Lock getLock(String id)
      Description copied from interface: LockManager
      Gets the lock on a document.

      If the document does not exist, null is returned.

      Specified by:
      getLock in interface LockManager
      Parameters:
      id - the document id
      Returns:
      the existing lock, or null when there is no lock
    • setLock

      public Lock setLock(String id, Lock lock)
      Description copied from interface: LockManager
      Sets a lock on a document.

      If the document is already locked, returns its existing lock status (there is no re-locking, LockManager.removeLock(java.lang.String, java.lang.String) must be called first).

      Specified by:
      setLock in interface LockManager
      Parameters:
      id - the document id
      lock - the lock to set
      Returns:
      null if locking succeeded, or the existing lock if locking failed
    • removeLock

      public Lock removeLock(String id, String owner)
      Description copied from interface: LockManager
      Removes the lock from a document.

      The previous lock is returned.

      If owner is null then the lock is unconditionally removed.

      If owner is not null, it must match the existing lock owner for the lock to be removed. If it doesn't match, the returned lock will return true for Lock.getFailed().

      Specified by:
      removeLock in interface LockManager
      Parameters:
      id - the document id
      owner - the owner to check, or null for no check
      Returns:
      the previous lock (may be null), with a failed flag if locking failed
    • closeLockManager

      public void closeLockManager()
      Description copied from interface: LockManager
      Closes the lock manager and releases resources.
      Specified by:
      closeLockManager in interface LockManager
    • clearLockManagerCaches

      public void clearLockManagerCaches()
      Description copied from interface: LockManager
      Clears any cache held by the lock manager.
      Specified by:
      clearLockManagerCaches in interface LockManager
    • getName

      public String getName()
      Specified by:
      getName in interface Repository
    • getSession

      public Session getSession()
      Specified by:
      getSession in interface Repository
    • markReferencedBlobs

      public void markReferencedBlobs(BiConsumer<String,String> markerCallback)
      Description copied from interface: Repository
      Marks the blobs in use by passing them to the provided callback (taking the blob key and the repository name).
      Specified by:
      markReferencedBlobs in interface Repository
    • getCapability

      public Object getCapability(String name)
      Description copied from interface: Repository
      Gets the value of the given capability for this repository.
      Specified by:
      getCapability in interface Repository
    • getBlobKeysPaths

      public List<List<String>> getBlobKeysPaths()
      Description copied from interface: DBSRepository
      Gets the list of blob keys paths of all possible blobs in all schemas.

      Each "path" is a list of path components. Example: [[content, data], [files, file, data], ...]

      Specified by:
      getBlobKeysPaths in interface DBSRepository
    • updateCapabilities

      public void updateCapabilities()
      Description copied from interface: DBSRepository
      Update repository capabilities after a migration. Internal use only.
      Specified by:
      updateCapabilities in interface DBSRepository