public class MemoryDirectorySession extends BaseSession
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Map<String,Object>> |
data |
autoincrementId, directory, directoryName, MULTI_TENANT_ID_FORMAT, passwordHashAlgorithm, permissions, POWER_USERS_GROUP, readAllColumns, READONLY_ENTRY_FLAG, referenceClass, schemaName, substringMatchType| Constructor and Description |
|---|
MemoryDirectorySession(MemoryDirectory 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.
|
void |
commit() |
DocumentModel |
createEntry(DocumentModel entry)
Creates an entry in a directory.
|
DocumentModel |
createEntry(Map<String,Object> fieldMap)
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.
|
MemoryDirectory |
getDirectory()
To be implemented with a more specific type.
|
DocumentModelList |
getEntries()
Retrieves all the entries in the directory.
|
DocumentModel |
getEntry(String id,
boolean fetchReferences)
Retrieves a directory entry using its id.
|
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)
Executes a query with the possibility to fetch references
|
void |
rollback() |
void |
updateEntry(DocumentModel docModel)
Updates a directory entry.
|
protected List<String> |
updateEntryWithoutReferences(DocumentModel docModel)
To be implemented for specific update.
|
checkDeleteConstraints, checkPermission, computeMultiTenantDirectoryId, createEntryModel, createEntryModel, getEntry, getEntryFromSource, getIdField, getPasswordField, getProjection, getProjection, hasPermission, hasPermission, isAuthenticating, isReadOnly, isReadOnlyEntry, query, query, query, query, setReadAllColumns, setReadOnlyEntry, setReadWriteEntrypublic MemoryDirectorySession(MemoryDirectory directory)
public MemoryDirectory getDirectory()
getDirectory in class BaseSessionpublic boolean authenticate(String username, String password) throws DirectoryException
SessionDirectoryExceptionpublic 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 void commit()
public void rollback() throws DirectoryException
DirectoryExceptionpublic DocumentModel createEntryWithoutReferences(Map<String,Object> fieldMap) throws DirectoryException
BaseSessioncreateEntryWithoutReferences in class BaseSessionDirectoryExceptionprotected List<String> updateEntryWithoutReferences(DocumentModel docModel) throws DirectoryException
BaseSessionupdateEntryWithoutReferences in class BaseSessionDirectoryExceptionprotected void deleteEntryWithoutReferences(String id) throws DirectoryException
BaseSessiondeleteEntryWithoutReferences in class BaseSessionDirectoryExceptionpublic DocumentModel createEntry(Map<String,Object> fieldMap) throws DirectoryException
SessioncreateEntry in interface SessioncreateEntry in class BaseSessionfieldMap - A map with keys and values that should be stored in a directory
Note: The values in the map should be of type String
DirectoryException - if a communication exception occurs or if an entry with the same id already exists.public void updateEntry(DocumentModel docModel) throws DirectoryException
SessionupdateEntry in interface SessionupdateEntry in class BaseSessiondocModel - The entry to updateDirectoryException - if a communication error occurspublic void deleteEntry(String id) throws DirectoryException
SessiondeleteEntry in interface SessiondeleteEntry in class BaseSessionid - the id of the entry to deleteDirectoryException - if a communication error occurspublic DocumentModel getEntry(String id, boolean fetchReferences) throws DirectoryException
SessiongetEntry in interface SessiongetEntry in class BaseSessionid - the entry idfetchReferences - boolean stating if references have to be fetchedDirectoryExceptionpublic DocumentModelList getEntries() throws DirectoryException
SessionDocumentModelList#totalsize on the returned list will return
-2 as a special marker for truncated results.getEntries in interface SessiongetEntries in class BaseSessionDirectoryExceptionSizeLimitExceededException - if the number of results is larger than the limit configured for the directory
and the server does not send partial results.public void deleteEntry(String id, Map<String,String> map) throws DirectoryException
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.DirectoryException - if a communication error occurs.public void deleteEntry(DocumentModel docModel) throws DirectoryException
SessiondeleteEntry in interface SessiondeleteEntry in class BaseSessiondocModel - The entry to deleteDirectoryException - if a communication error occurspublic DocumentModelList query(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences) throws DirectoryException
Sessionquery in interface Sessionquery in class BaseSessionDirectoryExceptionSession.query(Map, Set, Map)public DocumentModel createEntry(DocumentModel entry)
SessioncreateEntry in interface SessioncreateEntry in class BaseSessionentry - the document model representing the entry to createCopyright © 2018 Nuxeo. All rights reserved.