public class MultiDirectorySession extends BaseSession
Each source can build an entry aggregating fields from one or several directories.
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
MultiDirectorySession.SourceInfo  | 
protected class  | 
MultiDirectorySession.SubDirectoryInfo  | 
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 | 
|---|
MultiDirectorySession(MultiDirectory directory)  | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
authenticate(String username,
            String password)
Checks that the credentials provided by the UserManager match those registered in the directory. 
 | 
void | 
close()
Closes the session and all open result sets obtained from this session. 
 | 
DocumentModel | 
createEntry(DocumentModel entry)
Creates an entry in a directory. 
 | 
DocumentModel | 
createEntryWithoutReferences(Map<String,Object> fieldMap)
To be implemented for specific creation. 
 | 
void | 
deleteEntry(DocumentModel docModel)
Deletes a directory entry. 
 | 
void | 
deleteEntry(String id)
Deletes a directory entry by id. 
 | 
void | 
deleteEntry(String id,
           Map<String,String> map)
Deletes a directory entry by id and secondary ids. 
 | 
protected void | 
deleteEntryWithoutReferences(String id)
To be implemented for specific deletion. 
 | 
MultiDirectory | 
getDirectory()
To be implemented with a more specific return type. 
 | 
DocumentModelList | 
getEntries()
Retrieves all the entries in the directory. 
 | 
DocumentModel | 
getEntry(String id,
        boolean fetchReferences)
Retrieves a directory entry using its id. 
 | 
String | 
getName()  | 
List<String> | 
getProjection(Map<String,Serializable> filter,
             Set<String> fulltext,
             String columnName)  | 
boolean | 
hasEntry(String id)
Returns true if session has an entry with given id. 
 | 
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. 
 | 
void | 
updateEntry(DocumentModel docModel)
Updates a directory entry. 
 | 
protected List<String> | 
updateEntryWithoutReferences(DocumentModel docModel)
To be implemented for specific update. 
 | 
addTenantId, applyQueryLimits, applyQueryLimits, canDeleteMultiTenantEntry, checkDeleteConstraints, checkPermission, computeMultiTenantDirectoryId, createEntry, createEntryModel, createEntryModel, getCurrentTenantId, getEntry, getEntryFromSource, getIdField, getPasswordField, getProjection, hasPermission, hasPermission, isAuthenticating, isMultiTenant, isReadOnly, isReadOnlyEntry, query, query, query, query, setReadAllColumns, setReadOnlyEntry, setReadWriteEntry, toStringListpublic MultiDirectorySession(MultiDirectory directory)
public MultiDirectory getDirectory()
BaseSessiongetDirectory in class BaseSessionpublic 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 DocumentModel getEntry(String id, boolean fetchReferences)
SessiongetEntry in interface SessiongetEntry in class BaseSessionid - the entry idfetchReferences - boolean stating if references have to be fetchedpublic DocumentModelList getEntries()
SessionDocumentModelList#totalsize on the returned list will return
 -2 as a special marker for truncated results.getEntries in interface SessiongetEntries in class BaseSessionpublic DocumentModel createEntryWithoutReferences(Map<String,Object> fieldMap)
BaseSessioncreateEntryWithoutReferences in class BaseSessionprotected List<String> updateEntryWithoutReferences(DocumentModel docModel)
BaseSessionupdateEntryWithoutReferences in class BaseSessionprotected void deleteEntryWithoutReferences(String id)
BaseSessiondeleteEntryWithoutReferences in class BaseSessionpublic void deleteEntry(DocumentModel docModel)
SessiondeleteEntry in interface SessiondeleteEntry in class BaseSessiondocModel - The entry to deletepublic void deleteEntry(String id)
SessiondeleteEntry in interface SessiondeleteEntry in class BaseSessionid - the id of the entry to deletepublic void deleteEntry(String id, Map<String,String> map)
SessionThis is used for hierarchical vocabularies, where the actual unique key is the couple (parent, id).
deleteEntry in interface SessiondeleteEntry in class BaseSessionid - the id of the entry to delete.map - a map of secondary key values.public void updateEntry(DocumentModel docModel)
SessionupdateEntry in interface SessionupdateEntry in class BaseSessiondocModel - The entry to updatepublic 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)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 List<String> getProjection(Map<String,Serializable> filter, Set<String> fulltext, String columnName)
getProjection in interface SessiongetProjection in class BaseSessionpublic DocumentModel createEntry(DocumentModel entry)
SessioncreateEntry in interface SessioncreateEntry in class BaseSessionentry - the document model representing the entry to createCopyright © 2019 Nuxeo. All rights reserved.