Package org.nuxeo.ecm.directory.multi
Class MultiDirectorySession
java.lang.Object
org.nuxeo.ecm.directory.BaseSession
org.nuxeo.ecm.directory.multi.MultiDirectorySession
- All Implemented Interfaces:
AutoCloseable,EntrySource,Session
Directory session aggregating entries from different sources.
Each source can build an entry aggregating fields from one or several directories.
- Author:
- Florent Guillaume, Anahide Tchertchian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classNested classes/interfaces inherited from class org.nuxeo.ecm.directory.BaseSession
BaseSession.FieldDetector -
Field Summary
Fields inherited from class org.nuxeo.ecm.directory.BaseSession
autoincrementId, computeMultiTenantId, directory, directoryName, MULTI_TENANT_ID_FORMAT, passwordHashAlgorithm, permissions, POWER_USERS_GROUP, readAllColumns, READONLY_ENTRY_FLAG, referenceClass, schemaName, substringMatchType, TENANT_ID_FIELD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(String username, String password) Checks that the credentials provided by the UserManager match those registered in the directory.voidclose()Closes the session and all open result sets obtained from this session.createEntry(DocumentModel entry) Creates an entry in a directory.protected DocumentModelcreateEntryWithoutReferences(Map<String, Object> fieldMap) Creates an entry to the directory without creating its references.voiddeleteEntry(String idOrSysId) Deletes a directory entry by id.voiddeleteEntry(DocumentModel docModel) Deletes a directory entry.doCreateEntryWithoutReferences(Map<String, Object> fieldMap) To be implemented for specific creation.protected voiddoDeleteEntryWithoutReferences(String entryId) To be implemented for specific deletion.protected DocumentModelListdoQuery(DirectoryQueryBuilder queryBuilder) To be implemented for specific querying.doQueryIds(DirectoryQueryBuilder queryBuilder) To be implemented for specific querying.doUpdateEntryWithoutReferences(DocumentModel docModel) To be implemented for specific update.To be implemented with a more specific return type.Retrieves a directory entry using its id.getName()getProjection(Map<String, Serializable> filter, Set<String> fulltext, String columnName) booleanReturns true if session has an entry with given id.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. org.nuxeo.ecm.directory.BaseSession provides a default implementation fetching all results to return the subset.protected static voidsetProperties(DocumentModel doc, String schema, Map<String, Object> map) Sets the properties of the givendocandschemato the values provided by the givenmap, ensuring that anynullvalue gets transformed to an empty string for a string property.voidupdateEntry(DocumentModel docModel) Updates a directory entry.Methods inherited from class org.nuxeo.ecm.directory.BaseSession
addTenantId, applyQueryLimits, applyQueryLimits, canDeleteMultiTenantEntry, canDeleteMultiTenantEntry, checkDeleteConstraints, checkPermission, computeMultiTenantDirectoryId, createEntry, createEntryModel, createEntryModel, createEntryModel, createEntryModel, createEntryModel, createEntryModel, createQueryBuilderForIds, createQueryBuilderWithConfiguredFiltering, createQueryBuilderWithConfiguredFiltering, deleteEntryWithoutReferences, getCurrentTenantId, getEntryFromSource, getIdField, getPasswordField, getPrefixedFieldName, getPrefixedIdField, getProjection, hasPermission, hasPermission, isAuthenticating, isMultiTenant, isReadOnly, isReadOnlyEntry, query, query, query, query, query, query, queryIds, setReadAllColumns, setReadOnlyEntry, setReadWriteEntry, toStringList, updateEntryWithoutReferencesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.directory.Session
createEntryModel, getEntry
-
Constructor Details
-
MultiDirectorySession
-
-
Method Details
-
getDirectory
Description copied from class:BaseSessionTo be implemented with a more specific return type.- Specified by:
getDirectoryin classBaseSession
-
close
public void close()Description copied from interface:SessionCloses the session and all open result sets obtained from this session.Releases this Connection object's resources immediately instead of waiting for them to be automatically released.
TODO: should this operation auto-commit pending changes?
-
getName
-
authenticate
Description copied from interface:SessionChecks that the credentials provided by the UserManager match those registered in the directory. If username is not in the directory, this should return false instead of throrwing an exception.- Returns:
- true is the credentials match those stored in the directory
-
getEntry
Description copied from interface:SessionRetrieves a directory entry using its id.- Specified by:
getEntryin interfaceSession- Overrides:
getEntryin classBaseSession- Parameters:
idOrSysId- the entry idfetchReferences- boolean stating if references have to be fetched- Returns:
- a DocumentModel representing the entry
-
createEntryWithoutReferences
Description copied from class:BaseSessionCreates an entry to the directory without creating its references.- Overrides:
createEntryWithoutReferencesin classBaseSession- Implementation Note:
- Do not execute generic code because multi directory is a bridge to directories which will execute it
-
doCreateEntryWithoutReferences
Description copied from class:BaseSessionTo be implemented for specific creation.- Overrides:
doCreateEntryWithoutReferencesin classBaseSession
-
doUpdateEntryWithoutReferences
Description copied from class:BaseSessionTo be implemented for specific update.- Overrides:
doUpdateEntryWithoutReferencesin classBaseSession
-
doDeleteEntryWithoutReferences
Description copied from class:BaseSessionTo be implemented for specific deletion.- Overrides:
doDeleteEntryWithoutReferencesin classBaseSession
-
deleteEntry
Description copied from interface:SessionDeletes a directory entry.- Specified by:
deleteEntryin interfaceSession- Overrides:
deleteEntryin classBaseSession- Parameters:
docModel- The entry to delete
-
deleteEntry
Description copied from interface:SessionDeletes a directory entry by id.- Specified by:
deleteEntryin interfaceSession- Overrides:
deleteEntryin classBaseSession- Parameters:
idOrSysId- the id of the entry to delete
-
setProperties
Sets the properties of the givendocandschemato the values provided by the givenmap, ensuring that anynullvalue gets transformed to an empty string for a string property. -
updateEntry
Description copied from interface:SessionUpdates a directory entry.- Specified by:
updateEntryin interfaceSession- Overrides:
updateEntryin classBaseSession- Parameters:
docModel- The entry to update
-
query
public DocumentModelList query(Map<String, Serializable> filter, Set<String> fulltext, Map<String, String> orderBy, boolean fetchReferences, int limit, int offset) Description copied from interface:SessionExecutes a query with the possibility to fetch a subset of the results. org.nuxeo.ecm.directory.BaseSession provides a default implementation fetching all results to return the subset. Not recommended.limit- maximum number of results ignored if less than 1offset- number of rows skipped before starting, will be 0 if less than 0.- See Also:
-
doQuery
Description copied from class:BaseSessionTo be implemented for specific querying.- Overrides:
doQueryin classBaseSession- See Also:
-
doQueryIds
Description copied from class:BaseSessionTo be implemented for specific querying.- Overrides:
doQueryIdsin classBaseSession- See Also:
-
getProjection
public List<String> getProjection(Map<String, Serializable> filter, Set<String> fulltext, String columnName) - Specified by:
getProjectionin interfaceSession- Overrides:
getProjectionin classBaseSession
-
createEntry
Description copied from interface:SessionCreates an entry in a directory.- Specified by:
createEntryin interfaceSession- Overrides:
createEntryin classBaseSession- Parameters:
entry- the document model representing the entry to create- Returns:
- The new entry created in the directory
-
hasEntry
Description copied from interface:SessionReturns true if session has an entry with given id.- Specified by:
hasEntryin interfaceSession- Overrides:
hasEntryin classBaseSession
-