Class MongoDBRepository
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
-
- org.nuxeo.ecm.core.storage.mongodb.MongoDBRepository
-
- All Implemented Interfaces:
LockManager
,Repository
,DBSRepository
public class MongoDBRepository extends DBSRepositoryBase
MongoDB implementation of aRepository
.- Since:
- 5.9.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MongoDBRepository.MongoDBBlobFinder
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
DBSRepositoryBase.BlobFinder, DBSRepositoryBase.IdType
-
-
Field Summary
Fields Modifier and Type Field Description protected org.bson.conversions.Bson
binaryKeys
Keys used for document projection when marking all binaries for GC.protected com.mongodb.client.MongoCollection<org.bson.Document>
coll
protected MongoDBConverter
converter
static String
COUNTER_FIELD
static String
COUNTER_NAME_UUID
protected com.mongodb.client.MongoCollection<org.bson.Document>
countersColl
protected MongoDBCursorService
cursorService
protected MongoDBRepositoryDescriptor
descriptor
static String
FULLTEXT_INDEX_NAME
protected String
idKey
The key to use to store the id in the database.static String
LANGUAGE_FIELD
static Long
LONG_ZERO
protected static Duration
MAX_TIME_DEFAULT
Default maximum execution time for a query.protected long
maxTimeMS
Maximum execution time for a query.protected com.mongodb.client.MongoClient
mongoClient
static String
MONGODB_EACH
static String
MONGODB_ID
static String
MONGODB_INC
static String
MONGODB_META
static String
MONGODB_PULLALL
static String
MONGODB_PUSH
static String
MONGODB_SET
static String
MONGODB_TEXT_SCORE
static String
MONGODB_UNSET
static Double
ONE
static String
REPOSITORY_CONNECTION_PREFIX
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.protected static int
SEQUENCE_RANDOMIZED_BLOCKSIZE_DEFAULT
protected long
sequenceBlockSize
Sequence allocation block size.protected boolean
supportsSessions
protected boolean
supportsTransactions
static Double
ZERO
-
Fields inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
blobManager, changeTokenEnabled, DEBUG_UUIDS, fulltextConfiguration, idType, lockManager, repositoryName, selfRegisteredLockManager, TYPE_ROOT, UUID_ZERO, UUID_ZERO_DEBUG
-
-
Constructor Summary
Constructors Constructor Description MongoDBRepository(MongoDBRepositoryDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DBSRepositoryBase.IdType>
getAllowedIdTypes()
Gets the allowed id types for this DBS repository.protected com.mongodb.client.MongoClient
getClient()
protected com.mongodb.client.MongoCollection<org.bson.Document>
getCollection()
MongoDBConnection
getConnection()
Gets a new connection to this repository.protected MongoDBConverter
getConverter()
protected com.mongodb.client.MongoCollection<org.bson.Document>
getCountersCollection()
protected MongoDBCursorService
getCursorService()
protected String
getIdKey()
protected void
initBlobsPaths()
protected void
initRepository()
void
markReferencedBinaries()
Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.protected void
markReferencedBinaries(org.bson.Document ob, DocumentBlobManager blobManager)
protected void
markReferencedBinary(Object value, DocumentBlobManager blobManager)
void
shutdown()
protected boolean
supportsSessions()
boolean
supportsTransactions()
Checks whether this repository supports transactions.-
Methods inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
getBlobManager, getFulltextConfiguration, getIdType, getLock, getLockManager, getLockManagerName, getName, getSession, initLockManager, isChangeTokenEnabled, isFulltextDisabled, isFulltextSearchDisabled, isFulltextStoredInBlob, removeLock, setLock
-
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.api.lock.LockManager
clearLockManagerCaches, closeLockManager
-
Methods inherited from interface org.nuxeo.ecm.core.model.Repository
getActiveSessionsCount
-
-
-
-
Field Detail
-
REPOSITORY_CONNECTION_PREFIX
public static final String REPOSITORY_CONNECTION_PREFIX
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.The connection id will be
repository/[REPOSITORY_NAME]
.- See Also:
- Constant Field Values
-
MONGODB_ID
public static final String MONGODB_ID
- See Also:
- Constant Field Values
-
MONGODB_INC
public static final String MONGODB_INC
- See Also:
- Constant Field Values
-
MONGODB_SET
public static final String MONGODB_SET
- See Also:
- Constant Field Values
-
MONGODB_UNSET
public static final String MONGODB_UNSET
- See Also:
- Constant Field Values
-
MONGODB_PUSH
public static final String MONGODB_PUSH
- See Also:
- Constant Field Values
-
MONGODB_PULLALL
public static final String MONGODB_PULLALL
- Since:
- 11.5
- See Also:
- Constant Field Values
-
MONGODB_EACH
public static final String MONGODB_EACH
- See Also:
- Constant Field Values
-
MONGODB_META
public static final String MONGODB_META
- See Also:
- Constant Field Values
-
MONGODB_TEXT_SCORE
public static final String MONGODB_TEXT_SCORE
- See Also:
- Constant Field Values
-
FULLTEXT_INDEX_NAME
public static final String FULLTEXT_INDEX_NAME
- See Also:
- Constant Field Values
-
LANGUAGE_FIELD
public static final String LANGUAGE_FIELD
- See Also:
- Constant Field Values
-
SEQUENCE_RANDOMIZED_BLOCKSIZE_DEFAULT
protected static final int SEQUENCE_RANDOMIZED_BLOCKSIZE_DEFAULT
- See Also:
- Constant Field Values
-
COUNTER_NAME_UUID
public static final String COUNTER_NAME_UUID
- See Also:
- Constant Field Values
-
COUNTER_FIELD
public static final String COUNTER_FIELD
- See Also:
- Constant Field Values
-
MAX_TIME_DEFAULT
protected static final Duration MAX_TIME_DEFAULT
Default maximum execution time for a query.- Since:
- 11.1
-
sequenceBlockSize
protected long sequenceBlockSize
Sequence allocation block size.
-
descriptor
protected final MongoDBRepositoryDescriptor descriptor
-
mongoClient
protected final com.mongodb.client.MongoClient mongoClient
-
converter
protected final MongoDBConverter converter
-
cursorService
protected final MongoDBCursorService cursorService
-
coll
protected final com.mongodb.client.MongoCollection<org.bson.Document> coll
-
countersColl
protected final com.mongodb.client.MongoCollection<org.bson.Document> countersColl
-
supportsSessions
protected final boolean supportsSessions
-
supportsTransactions
protected final boolean supportsTransactions
-
maxTimeMS
protected final long maxTimeMS
Maximum execution time for a query.- Since:
- 11.1
-
binaryKeys
protected org.bson.conversions.Bson binaryKeys
Keys used for document projection when marking all binaries for GC.
-
-
Constructor Detail
-
MongoDBRepository
public MongoDBRepository(MongoDBRepositoryDescriptor descriptor)
-
-
Method Detail
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceRepository
- Overrides:
shutdown
in classDBSRepositoryBase
-
initRepository
protected void initRepository()
-
getConnection
public MongoDBConnection getConnection()
Description copied from interface:DBSRepository
Gets a new connection to this repository.- Returns:
- a new connection
-
getAllowedIdTypes
public List<DBSRepositoryBase.IdType> getAllowedIdTypes()
Description copied from class:DBSRepositoryBase
Gets the allowed id types for this DBS repository. The first one is the default.- Specified by:
getAllowedIdTypes
in classDBSRepositoryBase
-
supportsSessions
protected boolean supportsSessions()
-
supportsTransactions
public boolean supportsTransactions()
Description copied from interface:DBSRepository
Checks whether this repository supports transactions.- Returns:
true
if the repository supports transactions- See Also:
DBSConnection.begin()
,DBSConnection.commit()
,DBSConnection.rollback()
-
getClient
protected com.mongodb.client.MongoClient getClient()
-
getCursorService
protected MongoDBCursorService getCursorService()
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection()
-
getCountersCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCountersCollection()
-
getConverter
protected MongoDBConverter getConverter()
-
initBlobsPaths
protected void initBlobsPaths()
- Specified by:
initBlobsPaths
in classDBSRepositoryBase
-
markReferencedBinaries
public void markReferencedBinaries()
Description copied from interface:Repository
Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.
-
markReferencedBinaries
protected void markReferencedBinaries(org.bson.Document ob, DocumentBlobManager blobManager)
-
markReferencedBinary
protected void markReferencedBinary(Object value, DocumentBlobManager blobManager)
-
-