public interface DirectoryManager extends DirectoryService
NAME
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(long sessionId,
String username,
String password)
Checks that the credentials provided by the UserManager match those
registered in the directory.
|
void |
close(long sessionId)
Closes the session and all open result sets obtained from this session.
|
void |
commit(long sessionId)
Commits any changes on this session.
|
DocumentModel |
createEntry(long sessionId,
DocumentModel entry)
Creates an entry in a directory.
|
DocumentModel |
createEntry(long sessionId,
Map<String,Object> fieldMap)
Creates an entry in a directory.
|
void |
deleteEntry(long sessionId,
DocumentModel docModel)
Deletes a directory entry.
|
void |
deleteEntry(long sessionId,
String id)
Deletes a directory entry by id.
|
void |
deleteEntry(long sessionId,
String id,
Map<String,String> map)
Deletes a directory entry by id and secondary ids.
|
DocumentModelList |
getEntries(long sessionId)
Retrieves all the entries in the directory.
|
DocumentModel |
getEntry(long sessionId,
String id)
Retrieves a directory entry using its id.
|
DocumentModel |
getEntry(long sessionId,
String id,
boolean fetchReferences)
Retrieves a directory entry using its id.
|
String |
getIdField(long sessionId)
The Id field is the name of the field that is used a primary key: unique
and not null value in the whole directory.
|
String |
getPasswordField(long sessionId) |
List<String> |
getProjection(long sessionId,
Map<String,Serializable> filter,
Set<String> fulltext,
String columnName) |
List<String> |
getProjection(long sessionId,
Map<String,Serializable> filter,
String columnName)
Executes a query using filter and return only the column columnName.
|
boolean |
hasEntry(long sessionId,
String id)
Returns true if session has an entry with given id.
|
boolean |
isAuthenticating(long sessionId)
Tells whether the directory implementation can be used as an
authenticating backend for the UserManager (based on login / password
check).
|
boolean |
isReadOnly(long sessionId) |
DocumentModelList |
query(long sessionId,
Map<String,Serializable> filter)
Executes a simple query.
|
DocumentModelList |
query(long sessionId,
Map<String,Serializable> filter,
Set<String> fulltext)
Executes a simple query.
|
DocumentModelList |
query(long sessionId,
Map<String,Serializable> filter,
Set<String> fulltext,
Map<String,String> orderBy)
Executes a simple query.
|
DocumentModelList |
query(long sessionId,
Map<String,Serializable> filter,
Set<String> fulltext,
Map<String,String> orderBy,
boolean fetchReferences) |
void |
rollback(long sessionId)
Rollbacks any changes on this session.
|
void |
updateEntry(long sessionId,
DocumentModel docModel)
Updates a directory entry.
|
getDirectories, getDirectory, getDirectory, getDirectoryIdField, getDirectoryNames, getDirectoryPasswordField, getDirectorySchema, getParentDirectoryName, open, open, registerDirectory, unregisterDirectory
DocumentModel getEntry(long sessionId, String id) throws DirectoryException
TODO what happens when the entry is not found? return null if not found?
id
- the entry idDirectoryException
DocumentModel getEntry(long sessionId, String id, boolean fetchReferences) throws DirectoryException
id
- the entry idfetchReferences
- boolean stating if references have to be fetchedDirectoryException
getEntry(long, String)
DocumentModelList getEntries(long sessionId) throws DirectoryException
DirectoryException
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directoryDocumentModel createEntry(long sessionId, Map<String,Object> fieldMap) throws DirectoryException
fieldMap
- A map with keys and values that should be stored in a
directory
Note: The values in the map should be of type String
UnsupportedOperationException
- if the directory does not allow the
creation of new entriesDirectoryException
- if a communication exception occurs or if an
entry with the same id already exists.void updateEntry(long sessionId, DocumentModel docModel) throws DirectoryException
docModel
- The entry to updateUnsupportedOperationException
- if the directory does not support
entry updatingDirectoryException
- if a communication error occursvoid deleteEntry(long sessionId, DocumentModel docModel) throws DirectoryException
docModel
- The entry to deleteUnsupportedOperationException
- if the directory does not support
entry deletingDirectoryException
- if a communication error occursvoid deleteEntry(long sessionId, String id) throws DirectoryException
id
- the id of the entry to deleteUnsupportedOperationException
- if the directory does not support
entry deletingDirectoryException
- if a communication error occursvoid deleteEntry(long sessionId, String id, Map<String,String> map) throws DirectoryException
This is used for hierarchical vocabularies, where the actual unique key is the couple (parent, id).
sessionId
- the session id.id
- the id of the entry to delete.map
- a map of seconday key values.DirectoryException
- if a communication error occurs.DocumentModelList query(long sessionId, Map<String,Serializable> filter) throws DirectoryException
filter
- a filter to apply to entries in directoryDirectoryException
- if a communication error occursSizeLimitExceededException
- if the number of results is larger
than the limit configured for the directoryDocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext) throws DirectoryException
fieldNames present in the fulltext set are treated as a fulltext match.
filter
- a filter to apply to entries in directoryfulltext
- a set of field that should be treated as a fulltext
searchDirectoryException
- if a communication error occursSizeLimitExceededException
- if the number of results is larger
than the limit configured for the directoryDocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy) throws DirectoryException
fieldNames present in the fulltext set are treated as a fulltext match.
filter
- a filter to apply to entries in directoryorderBy
- a LinkedHashMap with the 'order by' criterias.The key of
an entry of this map represents the column name and the value
of the same entry represent the column order,which may be
'asc' or 'desc'.fulltext
- a set of field that should be treated as a fulltext
searchDirectoryException
- if a communication error occursSizeLimitExceededException
- if the number of results is larger
than the limit configured for the directoryDocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences) throws DirectoryException
DirectoryException
void commit(long sessionId) throws DirectoryException
UnsupportedOperationException
- if the directory does not support
transactionsDirectoryException
- if a communication error occurs
In this case the session will be automatically rollbacked
void rollback(long sessionId) throws DirectoryException
UnsupportedOperationException
- if the associated directory does
not support transactionsDirectoryException
- if a communication error occurs
In this case, the session will be automatically rollbacked anyway
void close(long sessionId) throws DirectoryException
Releases this Connection object's resources immediately instead of waiting for them to be automatically released.
TODO: should this operation auto-commit pending changes?
DirectoryException
- if a communication error occursList<String> getProjection(long sessionId, Map<String,Serializable> filter, String columnName) throws DirectoryException
filter
- the filter for the querycolumnName
- the column whose content should be returnedDirectoryException
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directoryList<String> getProjection(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, String columnName) throws DirectoryException
DirectoryException
boolean isAuthenticating(long sessionId) throws DirectoryException
DirectoryException
boolean authenticate(long sessionId, String username, String password) throws DirectoryException
username
- password
- DirectoryException
String getIdField(long sessionId) throws DirectoryException
DirectoryException
String getPasswordField(long sessionId) throws DirectoryException
DirectoryException
boolean isReadOnly(long sessionId) throws DirectoryException
DirectoryException
boolean hasEntry(long sessionId, String id) throws DirectoryException
DirectoryException
DocumentModel createEntry(long sessionId, DocumentModel entry) throws DirectoryException
entry
- the document model representing the entry to createUnsupportedOperationException
- if the directory does not allow the
creation of new entriesDirectoryException
- if a communication exception occurs or if an
entry with the same id already exists.Copyright © 2013 Nuxeo SA. All Rights Reserved.