|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.platform.directory.ejb.DirectoryManagerBean
public class DirectoryManagerBean
Facade Bean provide Remoting API for DirectoryService
Field Summary |
---|
Fields inherited from interface org.nuxeo.ecm.directory.api.DirectoryService |
---|
NAME |
Constructor Summary | |
---|---|
DirectoryManagerBean()
|
Method Summary | |
---|---|
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> map)
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. |
List<Directory> |
getDirectories()
|
Directory |
getDirectory(String name)
|
String |
getDirectoryIdField(String directoryName)
|
List<String> |
getDirectoryNames()
|
String |
getDirectoryPasswordField(String directoryName)
|
String |
getDirectorySchema(String directoryName)
|
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 |
getParentDirectoryName(String directoryName)
Returns the name of the parent directory of specified directory, if applicable. |
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. |
void |
initialize()
|
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)
|
Session |
open(String directoryName)
Opens a session on specified directory. |
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 |
registerDirectory(String directoryName,
DirectoryFactory factory)
|
void |
rollback(long sessionId)
Rollbacks any changes on this session. |
void |
unregisterDirectory(String directoryName,
DirectoryFactory factory)
|
void |
updateEntry(long sessionId,
DocumentModel docModel)
Updates a directory entry. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirectoryManagerBean()
Method Detail |
---|
@PostConstruct public void initialize()
public boolean authenticate(long sessionId, String username, String password) throws DirectoryException
DirectoryManager
authenticate
in interface DirectoryManager
DirectoryException
public void close(long sessionId) throws DirectoryException
DirectoryManager
Releases this Connection object's resources immediately instead of waiting for them to be automatically released.
TODO: should this operation auto-commit pending changes?
close
in interface DirectoryManager
DirectoryException
- if a communication error occurspublic void commit(long sessionId) throws DirectoryException
DirectoryManager
commit
in interface DirectoryManager
DirectoryException
- if a communication error occurs
In this case the session will be automatically rollbacked
public DocumentModel createEntry(long sessionId, Map<String,Object> map) throws DirectoryException
DirectoryManager
createEntry
in interface DirectoryManager
map
- 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 deleteEntry(long sessionId, DocumentModel docModel) throws DirectoryException
DirectoryManager
deleteEntry
in interface DirectoryManager
docModel
- The entry to delete
DirectoryException
- if a communication error occurspublic void deleteEntry(long sessionId, String id) throws DirectoryException
DirectoryManager
deleteEntry
in interface DirectoryManager
id
- the id of the entry to delete
DirectoryException
- if a communication error occurspublic void deleteEntry(long sessionId, String id, Map<String,String> map) throws DirectoryException
DirectoryManager
This is used for hierarchical vocabularies, where the actual unique key is the couple (parent, id).
deleteEntry
in interface DirectoryManager
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.public DocumentModelList getEntries(long sessionId) throws DirectoryException
DirectoryManager
getEntries
in interface DirectoryManager
DirectoryException
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directorypublic DocumentModel getEntry(long sessionId, String id) throws DirectoryException
DirectoryManager
TODO what happens when the entry is not found? return null if not found?
getEntry
in interface DirectoryManager
id
- the entry id
DirectoryException
public DocumentModel getEntry(long sessionId, String id, boolean fetchReferences) throws DirectoryException
DirectoryManager
getEntry
in interface DirectoryManager
id
- the entry idfetchReferences
- boolean stating if references have to be fetched
DirectoryException
DirectoryManager.getEntry(long, String)
public String getIdField(long sessionId) throws DirectoryException
DirectoryManager
getIdField
in interface DirectoryManager
DirectoryException
public String getPasswordField(long sessionId) throws DirectoryException
getPasswordField
in interface DirectoryManager
DirectoryException
public List<String> getProjection(long sessionId, Map<String,Serializable> filter, String columnName) throws DirectoryException
DirectoryManager
getProjection
in interface DirectoryManager
filter
- the filter for the querycolumnName
- the column whose content should be returned
DirectoryException
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directorypublic List<String> getProjection(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, String columnName) throws DirectoryException
getProjection
in interface DirectoryManager
DirectoryException
public boolean isAuthenticating(long sessionId) throws DirectoryException
DirectoryManager
isAuthenticating
in interface DirectoryManager
DirectoryException
public boolean isReadOnly(long sessionId) throws DirectoryException
isReadOnly
in interface DirectoryManager
DirectoryException
public DocumentModelList query(long sessionId, Map<String,Serializable> filter) throws DirectoryException
DirectoryManager
query
in interface DirectoryManager
filter
- a filter to apply to entries in directory
DirectoryException
- if a communication error occurs
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directorypublic DocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext) throws DirectoryException
DirectoryManager
fieldNames present in the fulltext set are treated as a fulltext match.
query
in interface DirectoryManager
filter
- a filter to apply to entries in directoryfulltext
- a set of field that should be treated as a fulltext
search
DirectoryException
- if a communication error occurs
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directorypublic DocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy) throws DirectoryException
DirectoryManager
fieldNames present in the fulltext set are treated as a fulltext match.
query
in interface DirectoryManager
filter
- a filter to apply to entries in directoryfulltext
- a set of field that should be treated as a fulltext
searchorderBy
- 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'.
DirectoryException
- if a communication error occurs
SizeLimitExceededException
- if the number of results is larger
than the limit configured for the directorypublic DocumentModelList query(long sessionId, Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences) throws DirectoryException
query
in interface DirectoryManager
DirectoryException
public void rollback(long sessionId) throws DirectoryException
DirectoryManager
rollback
in interface DirectoryManager
DirectoryException
- if a communication error occurs
In this case, the session will be automatically rollbacked anyway
public void updateEntry(long sessionId, DocumentModel docModel) throws DirectoryException
DirectoryManager
updateEntry
in interface DirectoryManager
docModel
- The entry to update
DirectoryException
- if a communication error occurspublic List<String> getDirectoryNames() throws DirectoryException
getDirectoryNames
in interface DirectoryService
DirectoryException
public String getDirectorySchema(String directoryName) throws DirectoryException
getDirectorySchema
in interface DirectoryService
DirectoryException
public Session open(String directoryName) throws DirectoryException
DirectoryService
This method prefers to throw rather than returning null.
open
in interface DirectoryService
DirectoryException
- in case the session cannot be createdpublic Directory getDirectory(String name) throws DirectoryException
getDirectory
in interface DirectoryService
DirectoryException
public List<Directory> getDirectories() throws DirectoryException
getDirectories
in interface DirectoryService
DirectoryException
public String getDirectoryIdField(String directoryName) throws DirectoryException
getDirectoryIdField
in interface DirectoryService
DirectoryException
public String getDirectoryPasswordField(String directoryName) throws DirectoryException
getDirectoryPasswordField
in interface DirectoryService
DirectoryException
public void registerDirectory(String directoryName, DirectoryFactory factory)
registerDirectory
in interface DirectoryService
public void unregisterDirectory(String directoryName, DirectoryFactory factory)
unregisterDirectory
in interface DirectoryService
public String getParentDirectoryName(String directoryName) throws DirectoryException
DirectoryService
getParentDirectoryName
in interface DirectoryService
DirectoryException
public DocumentModel createEntry(long sessionId, DocumentModel entry) throws DirectoryException
DirectoryManager
createEntry
in interface DirectoryManager
entry
- the document model representing the entry to create
DirectoryException
- if a communication exception occurs or if an
entry with the same id already exists.public boolean hasEntry(long sessionId, String id) throws DirectoryException
DirectoryManager
hasEntry
in interface DirectoryManager
DirectoryException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |