public class MongoDBSession extends BaseSession
Session| Modifier and Type | Class and Description | 
|---|---|
class  | 
MongoDBSession.MongoDBDirectoryQueryBuilder
MongoDB Query Builder that knows how to resolved directory properties. 
 | 
BaseSession.FieldDetectorautoincrementId, computeMultiTenantId, directory, directoryName, MULTI_TENANT_ID_FORMAT, passwordHashAlgorithm, permissions, POWER_USERS_GROUP, readAllColumns, READONLY_ENTRY_FLAG, referenceClass, schemaName, substringMatchType, TENANT_ID_FIELD| Constructor and Description | 
|---|
MongoDBSession(MongoDBDirectory directory)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
addField(org.bson.Document bson,
        String key,
        Object value)  | 
boolean | 
authenticate(String username,
            String password)
Checks that the credentials provided by the UserManager match those registered in the directory. 
 | 
protected org.bson.Document | 
buildQuery(Map<String,Serializable> fieldMap,
          Set<String> fulltext)  | 
protected boolean | 
checkEntryTenantId(String entryTenantId)  | 
void | 
close()
Closes the session and all open result sets obtained from this session. 
 | 
protected DocumentModel | 
createEntryWithoutReferences(Map<String,Object> fieldMap)
To be implemented for specific creation. 
 | 
void | 
deleteEntryWithoutReferences(String id)
To be implemented for specific deletion. 
 | 
protected DocumentModelList | 
doQuery(Map<String,Serializable> filter,
       Set<String> fulltext,
       Map<String,String> orderBy,
       boolean fetchReferences,
       int limit,
       int offset,
       boolean checkTenantId)  | 
protected DocumentModel | 
fieldMapToDocumentModel(Map<String,Object> fieldMap)  | 
protected com.mongodb.client.MongoCollection<org.bson.Document> | 
getCollection()
Retrieve the collection associated to this directory 
 | 
protected com.mongodb.client.MongoCollection<org.bson.Document> | 
getCountersCollection()
Retrieve the counters collection associated to this directory 
 | 
MongoDBDirectory | 
getDirectory()
To be implemented with a more specific return type. 
 | 
DocumentModel | 
getEntryFromSource(String id,
                  boolean fetchReferences)  | 
protected String | 
getIdFromState(State state)  | 
protected String | 
getPrefixedIdField()  | 
protected String | 
getPrefixedPasswordField()  | 
boolean | 
hasEntry(String id)
Returns true if session has an entry with given id. 
 | 
boolean | 
isAuthenticating()
Tells whether the directory implementation can be used as an authenticating backend for the UserManager (based on
 login / password check). 
 | 
DocumentModelList | 
query(Map<String,Serializable> filter,
     Set<String> fulltext,
     Map<String,String> orderBy,
     boolean fetchReferences,
     int limit,
     int offset)
Executes a query with the possibility to fetch a subset of the results. 
 | 
DocumentModelList | 
query(QueryBuilder queryBuilder,
     boolean fetchReferences)
Executes a query with the possibility to fetch a subset of the results. 
 | 
List<String> | 
queryIds(QueryBuilder queryBuilder)
Executes a query with the possibility to fetch a subset of the results. 
 | 
protected List<String> | 
updateEntryWithoutReferences(DocumentModel docModel)
To be implemented for specific update. 
 | 
addTenantId, applyQueryLimits, applyQueryLimits, canDeleteMultiTenantEntry, checkDeleteConstraints, checkPermission, computeMultiTenantDirectoryId, createEntry, createEntry, createEntryModel, createEntryModel, deleteEntry, deleteEntry, deleteEntry, getCurrentTenantId, getEntries, getEntry, getEntry, getIdField, getPasswordField, getProjection, getProjection, hasPermission, hasPermission, isMultiTenant, isReadOnly, isReadOnlyEntry, query, query, query, query, setReadAllColumns, setReadOnlyEntry, setReadWriteEntry, toStringList, updateEntrypublic MongoDBSession(MongoDBDirectory directory)
public MongoDBDirectory getDirectory()
BaseSessiongetDirectory in class BaseSessionpublic DocumentModel getEntryFromSource(String id, boolean fetchReferences)
getEntryFromSource in interface EntrySourcegetEntryFromSource in class BaseSessionprotected DocumentModel createEntryWithoutReferences(Map<String,Object> fieldMap)
BaseSessioncreateEntryWithoutReferences in class BaseSessionprotected List<String> updateEntryWithoutReferences(DocumentModel docModel)
BaseSessionupdateEntryWithoutReferences in class BaseSessionpublic void deleteEntryWithoutReferences(String id)
BaseSessiondeleteEntryWithoutReferences in class BaseSessionpublic DocumentModelList query(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences, int limit, int offset)
Sessionlimit - maximum number of results ignored if less than 1offset - number of rows skipped before starting, will be 0 if less than 0.Session.query(Map, Set, Map, boolean)protected DocumentModelList doQuery(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences, int limit, int offset, boolean checkTenantId)
protected org.bson.Document buildQuery(Map<String,Serializable> fieldMap, Set<String> fulltext)
public DocumentModelList query(QueryBuilder queryBuilder, boolean fetchReferences)
SessionqueryBuilder - the query to use, including limit, offset, ordering and countTotalfetchReferences - boolean stating if references have to be fetchedpublic List<String> queryIds(QueryBuilder queryBuilder)
SessionqueryBuilder - the query to use, including limit, offset and orderingpublic void close()
SessionReleases this Connection object's resources immediately instead of waiting for them to be automatically released.
TODO: should this operation auto-commit pending changes?
public boolean authenticate(String username, String password)
Sessionpublic boolean isAuthenticating()
SessionisAuthenticating in interface SessionisAuthenticating in class BaseSessionpublic boolean hasEntry(String id)
Sessionprotected com.mongodb.client.MongoCollection<org.bson.Document> getCollection()
protected com.mongodb.client.MongoCollection<org.bson.Document> getCountersCollection()
protected DocumentModel fieldMapToDocumentModel(Map<String,Object> fieldMap)
protected String getIdFromState(State state)
protected boolean checkEntryTenantId(String entryTenantId)
protected String getPrefixedIdField()
protected String getPrefixedPasswordField()
Copyright © 2019 Nuxeo. All rights reserved.