Class DBSRepositoryBase

java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
All Implemented Interfaces:
LockManager, Repository, DBSRepository
Direct Known Subclasses:
MemRepository, MongoDBRepository

public abstract class DBSRepositoryBase extends Object implements DBSRepository
Provides sharing behavior for repository sessions and other basic functions.
Since:
5.9.4
  • Field Details

    • DISABLE_ECM_BLOB_KEYS

      protected static final String DISABLE_ECM_BLOB_KEYS
      Property to disable ecm:blobKeys computation FOR TEST PURPOSE ONLY. Keep it private, we really don't want it to be used externally.
      Since:
      2023
      See Also:
    • TYPE_ROOT

      public static final String TYPE_ROOT
      See Also:
    • DEBUG_UUIDS

      public static final boolean DEBUG_UUIDS
      See Also:
    • UUID_ZERO

      public static final String UUID_ZERO
      See Also:
    • UUID_ZERO_DEBUG

      public static final String UUID_ZERO_DEBUG
      See Also:
    • idType

      protected final DBSRepositoryBase.IdType idType
      Since:
      8.3
    • repositoryName

      protected final String repositoryName
    • fulltextConfiguration

      protected final FulltextConfiguration fulltextConfiguration
    • blobManager

      protected final BlobManager blobManager
    • lockManager

      protected LockManager lockManager
    • changeTokenEnabled

      protected final boolean changeTokenEnabled
    • capabilities

      protected final Map<String,Object> capabilities
      Since:
      11.5
    • selfRegisteredLockManager

      protected boolean selfRegisteredLockManager
      Since:
      7.4 : used to know if the LockManager was provided by this repository or externally
    • blobKeysPaths

      protected List<List<String>> blobKeysPaths
  • Constructor Details

  • Method Details

    • getAllowedIdTypes

      public abstract List<DBSRepositoryBase.IdType> getAllowedIdTypes()
      Gets the allowed id types for this DBS repository. The first one is the default.
    • getIdType

      public DBSRepositoryBase.IdType getIdType()
      Since:
      11.1
    • shutdown

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

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

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

      protected String getLockManagerName()
    • initLockManager

      protected void initLockManager()
    • 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
    • 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
    • initBlobsPaths

      protected void initBlobsPaths()
    • getBlobManager

      public BlobManager getBlobManager()
      Description copied from interface: DBSRepository
      Gets the blob manager.
      Specified by:
      getBlobManager in interface DBSRepository
      Returns:
      the blob manager.
    • 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
    • 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
    • getSession

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