Package org.nuxeo.directory.mongodb
Class MongoDBDirectory
java.lang.Object
org.nuxeo.ecm.directory.AbstractDirectory
org.nuxeo.directory.mongodb.MongoDBDirectory
- All Implemented Interfaces:
Directory
MongoDB implementation of a
Directory
- Since:
- 9.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.directory.AbstractDirectory
AbstractDirectory.CSVLoaderConsumer
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.mongodb.client.MongoCollection<org.bson.Document>
protected com.mongodb.client.MongoCollection<org.bson.Document>
protected com.mongodb.client.MongoDatabase
static final String
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.Fields inherited from class org.nuxeo.ecm.directory.AbstractDirectory
cache, descriptor, fieldMapper, referenceClass, references, registry, schemaFieldMap, sessionCount, sessionMaxCount, TENANT_ID_FIELD, types
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected com.mongodb.client.MongoCollection<org.bson.Document>
Retrieves the collection associated to this directory.protected com.mongodb.client.MongoCollection<org.bson.Document>
Retrieves the counters collection associated to this directory.Get descriptorCreates a session for accessing entries in this directory.protected boolean
hasCollection
(String collection) Checks if the MongoDB server has the collection.void
INTERNAL, DO NOT CALL.void
INTERNAL, DO NOT CALL.boolean
Returnstrue
if this directory is a multi tenant directory,false
otherwise.Methods inherited from class org.nuxeo.ecm.directory.AbstractDirectory
addInverseReferences, addReference, addSession, doSanityChecks, fallbackOnDefaultCache, getCache, getDirectoryDeleteConstraints, getFieldMapper, getIdField, getName, getParentDirectory, getPasswordField, getReferences, getReferences, getSchema, getSchemaFieldMap, getTypes, initializeInverseReferences, initSchemaFieldMap, invalidateCaches, invalidateDirectoryCache, isReadOnly, isReference, loadData, loadDataOnInit, loadFromCSV, makeOrderBy, newReference, orderEntries, removeSession, setReadOnly, shutdown
-
Field Details
-
DIRECTORY_CONNECTION_PREFIX
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.The connection id will be
directory/[DIRECTORY_NAME]
.- Since:
- 10.10
- See Also:
-
database
protected com.mongodb.client.MongoDatabase database -
collection
protected com.mongodb.client.MongoCollection<org.bson.Document> collection -
countersCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> countersCollection
-
-
Constructor Details
-
MongoDBDirectory
-
-
Method Details
-
getDescriptor
Description copied from interface:Directory
Get descriptor -
addReferences
protected void addReferences()- Overrides:
addReferences
in classAbstractDirectory
-
getSession
Description copied from interface:Directory
Creates a session for accessing entries in this directory.- Returns:
- a Session object
-
isMultiTenant
public boolean isMultiTenant()Description copied from interface:Directory
Returnstrue
if this directory is a multi tenant directory,false
otherwise.- Specified by:
isMultiTenant
in interfaceDirectory
- Overrides:
isMultiTenant
in classAbstractDirectory
-
initialize
public void initialize()Description copied from interface:Directory
INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initialize
in interfaceDirectory
- Overrides:
initialize
in classAbstractDirectory
-
createIndexes
protected void createIndexes() -
initializeReferences
public void initializeReferences()Description copied from interface:Directory
INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initializeReferences
in interfaceDirectory
- Overrides:
initializeReferences
in classAbstractDirectory
-
hasCollection
Checks if the MongoDB server has the collection.- Parameters:
collection
- the collection name- Returns:
- true if the server has the collection, false otherwise
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection()Retrieves the collection associated to this directory.- Returns:
- the MongoDB collection
-
getCountersCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCountersCollection()Retrieves the counters collection associated to this directory.- Returns:
- the MongoDB counters collection
-