Package org.nuxeo.ecm.core.storage.dbs
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DBSRepositoryBase.BlobFinder
Finds the paths for all blobs in all document types.static class
DBSRepositoryBase.IdType
Type of id to used for documents.
-
Field Summary
Fields Modifier and Type Field Description protected BlobManager
blobManager
protected boolean
changeTokenEnabled
static boolean
DEBUG_UUIDS
protected FulltextConfiguration
fulltextConfiguration
protected DBSRepositoryBase.IdType
idType
protected LockManager
lockManager
protected String
repositoryName
protected boolean
selfRegisteredLockManager
static String
TYPE_ROOT
static String
UUID_ZERO
static String
UUID_ZERO_DEBUG
-
Constructor Summary
Constructors Constructor Description DBSRepositoryBase(String repositoryName, DBSRepositoryDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract List<DBSRepositoryBase.IdType>
getAllowedIdTypes()
Gets the allowed id types for this DBS repository.BlobManager
getBlobManager()
Gets the blob manager.FulltextConfiguration
getFulltextConfiguration()
Gets the fulltext configuration for this repository.DBSRepositoryBase.IdType
getIdType()
Lock
getLock(String id)
Gets the lock on a document.LockManager
getLockManager()
Gets the lock manager for this repository.protected String
getLockManagerName()
String
getName()
Session
getSession()
protected abstract void
initBlobsPaths()
protected void
initLockManager()
boolean
isChangeTokenEnabled()
Checks if database-managed document change tokens are enabled.boolean
isFulltextDisabled()
Checks if fulltext indexing (and search) is disabled.boolean
isFulltextSearchDisabled()
Checks if fulltext search is disabled.boolean
isFulltextStoredInBlob()
Checks if fulltext is stored in a blob.Lock
removeLock(String id, String owner)
Removes the lock from a document.Lock
setLock(String id, Lock lock)
Sets a lock on a document.void
shutdown()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.storage.dbs.DBSRepository
getConnection, supportsTransactions
-
Methods inherited from interface org.nuxeo.ecm.core.api.lock.LockManager
clearLockManagerCaches, closeLockManager
-
Methods inherited from interface org.nuxeo.ecm.core.model.Repository
getActiveSessionsCount, markReferencedBinaries
-
-
-
-
Field Detail
-
TYPE_ROOT
public static final String TYPE_ROOT
- See Also:
- Constant Field Values
-
DEBUG_UUIDS
public static final boolean DEBUG_UUIDS
- See Also:
- Constant Field Values
-
UUID_ZERO
public static final String UUID_ZERO
- See Also:
- Constant Field Values
-
UUID_ZERO_DEBUG
public static final String UUID_ZERO_DEBUG
- See Also:
- Constant Field Values
-
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
-
selfRegisteredLockManager
protected boolean selfRegisteredLockManager
- Since:
- 7.4 : used to know if the LockManager was provided by this repository or externally
-
-
Constructor Detail
-
DBSRepositoryBase
public DBSRepositoryBase(String repositoryName, DBSRepositoryDescriptor descriptor)
-
-
Method Detail
-
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 interfaceRepository
-
getName
public String getName()
- Specified by:
getName
in interfaceRepository
-
getFulltextConfiguration
public FulltextConfiguration getFulltextConfiguration()
Description copied from interface:Repository
Gets the fulltext configuration for this repository.- Specified by:
getFulltextConfiguration
in interfaceRepository
-
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 interfaceDBSRepository
- 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 interfaceLockManager
- 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 interfaceLockManager
- Parameters:
id
- the document idlock
- 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
isnull
then the lock is unconditionally removed.If
owner
is notnull
, it must match the existing lock owner for the lock to be removed. If it doesn't match, the returned lock will returntrue
forLock.getFailed()
.- Specified by:
removeLock
in interfaceLockManager
- Parameters:
id
- the document idowner
- the owner to check, ornull
for no check- Returns:
- the previous lock (may be
null
), with a failed flag if locking failed
-
initBlobsPaths
protected abstract void initBlobsPaths()
-
getBlobManager
public BlobManager getBlobManager()
Description copied from interface:DBSRepository
Gets the blob manager.- Specified by:
getBlobManager
in interfaceDBSRepository
- 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 interfaceDBSRepository
- 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 interfaceDBSRepository
- 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 interfaceDBSRepository
- 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 interfaceDBSRepository
- Returns:
true
if the database maintains document change tokens
-
getSession
public Session getSession()
- Specified by:
getSession
in interfaceRepository
-
-