Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.usermanager
Interface UserManager

All Superinterfaces:
Authenticator, Serializable
All Known Implementing Classes:
FakeUserManagerImpl, UserManagerImpl, UserManagerWithComputedGroups

public interface UserManager
extends Authenticator, Serializable

Author:
Anahide Tchertchian, Sun Seng David TAN , Benjamin Jalon

Nested Class Summary
static class UserManager.MatchType
           
 
Method Summary
 Boolean areGroupsReadOnly()
          Returns true is users referential is read only (ie : LDAP) -> can not add users -> can not delete users.
 Boolean areUsersReadOnly()
          Returns true is groups referential is read only (ie : LDAP) -> can not add groups -> can not delete groups.
 boolean checkUsernamePassword(String username, String password)
          Check the password for the given username.
 DocumentModel createGroup(DocumentModel groupModel)
          Creates a group from given model
 void createGroup(NuxeoGroup group)
          Deprecated. use createGroup(DocumentModel)
 void createPrincipal(NuxeoPrincipal principal)
          Deprecated. use createUser(DocumentModel)
 DocumentModel createUser(DocumentModel userModel)
          Creates user from given model.
 void deleteGroup(DocumentModel groupModel)
          Deletes group represented by given model.
 void deleteGroup(NuxeoGroup group)
          Deprecated. use deleteGroup(DocumentModel)
 void deleteGroup(String groupId)
          Deletes group with given id.
 void deletePrincipal(NuxeoPrincipal principal)
          Deprecated. use deleteUser(DocumentModel)
 void deleteUser(DocumentModel userModel)
          Deletes user represented by given model.
 void deleteUser(String userId)
          Deletes user with given id.
 List<String> getAdministratorsGroups()
          Returns the list of administrators groups.
 String getAnonymousUserId()
          Gets the anonymous user id.
 List<NuxeoGroup> getAvailableGroups()
          Deprecated. use getGroupIds() or searchGroups(Map, Set)
 List<NuxeoPrincipal> getAvailablePrincipals()
          Deprecated. use getUserIds() or #searchUsers(null)
 DocumentModel getBareGroupModel()
          Returns a bare group model.
 DocumentModel getBareUserModel()
          Returns a bare user model.
 String getDefaultGroup()
           
 String getDigestAuthDirectory()
          Gets the Digest Auth directory.
 String getDigestAuthRealm()
          Gets the Digest Auth realm.
 NuxeoGroup getGroup(String groupName)
          Returns the nuxeo group with given name or null if it does not exist.
 String getGroupDirectoryName()
          Gets the group directory name.
 String getGroupIdField()
          Returns the group directory id field.
 List<String> getGroupIds()
          Returns the list of all groups ids.
 String getGroupLabelField()
          Returns the group label field.
 String getGroupListingMode()
           
 String getGroupMembersField()
          Gets the group members field.
 DocumentModel getGroupModel(String groupName)
          Return the group document model with this id or null if group does not exist.
 String getGroupParentGroupsField()
          Gets the group parent-groups field.
 String getGroupSchemaName()
          Returns the group directory schema name.
 Set<String> getGroupSearchFields()
          Gets the group search fields.
 List<String> getGroupsInGroup(String parentId)
          Returns the list of groups that belong to this group.
 String getGroupSubGroupsField()
          Gets the group sub-groups field.
 DocumentModel getModelForUser(String name)
          Deprecated. use getUserModel(String)
 NuxeoPrincipal getPrincipal(String username)
          Retrieves the principal with the given username or null if it does not exist.
 List<String> getTopLevelGroups()
          Returns the list of groups that are not members of other groups.
 String getUserDirectoryName()
          Gets the user directory name.
 String getUserEmailField()
          Gets the user email field.
 String getUserIdField()
          Returns the user directory id field.
 List<String> getUserIds()
          Returns the list of all user ids.
 String getUserListingMode()
           
 DocumentModel getUserModel(String userName)
          Returns the document model representing user with given id or null if it does not exist.
 Pattern getUserPasswordPattern()
           
 String getUserSchemaName()
          Returns the user directory schema name.
 Set<String> getUserSearchFields()
          Gets the user search fields, the fields to use when a principal search is done.
 String[] getUsersForPermission(String perm, ACP acp)
          For an ACP, get the list of user that has a permission.
 List<String> getUsersInGroup(String groupId)
          Returns the list of users that belong to this group.
 List<String> getUsersInGroupAndSubGroups(String groupId)
          Get users from a group and its subgroups.
 String getUserSortField()
           
 List<NuxeoPrincipal> searchByMap(Map<String,Serializable> filter, Set<String> pattern)
          Deprecated. use searchUsers(Map, Set)
 DocumentModelList searchGroups(Map<String,Serializable> filter, Set<String> fulltext)
          Returns groups matching given criteria.
 DocumentModelList searchGroups(String pattern)
          Search matching groups through their defined search fields
 List<NuxeoPrincipal> searchPrincipals(String pattern)
          Deprecated. see searchUsers(String)
 DocumentModelList searchUsers(Map<String,Serializable> filter, Set<String> fulltext)
          Returns users matching given criteria.
 DocumentModelList searchUsers(String pattern)
          Returns users matching given pattern
 void setConfiguration(UserManagerDescriptor descriptor)
          Sets the given configuration on the service.
 void updateGroup(DocumentModel groupModel)
          Updates group represented by given model.
 void updateGroup(NuxeoGroup group)
          Deprecated. use updateGroup(DocumentModel)
 void updatePrincipal(NuxeoPrincipal principal)
          Deprecated. use updateUser(DocumentModel)
 void updateUser(DocumentModel userModel)
          Updates user represented by given model.
 boolean validatePassword(String password)
           
 
Methods inherited from interface org.nuxeo.runtime.api.login.Authenticator
authenticate
 

Method Detail

checkUsernamePassword

boolean checkUsernamePassword(String username,
                              String password)
                              throws ClientException
Description copied from interface: Authenticator
Check the password for the given username. Returns true if the username / password pair match, false otherwise.

Specified by:
checkUsernamePassword in interface Authenticator
Parameters:
username - the username
password - the password to check
Returns:
true is valid, false otherwise
Throws:
ClientException

validatePassword

boolean validatePassword(String password)
                         throws ClientException
Throws:
ClientException

getPrincipal

NuxeoPrincipal getPrincipal(String username)
                            throws ClientException
Retrieves the principal with the given username or null if it does not exist.

Can build principals for anonymous and virtual users as well as for users defined in the users directory.

Throws:
ClientException

getGroup

NuxeoGroup getGroup(String groupName)
                    throws ClientException
Returns the nuxeo group with given name or null if it does not exist.

Throws:
ClientException

searchPrincipals

@Deprecated
List<NuxeoPrincipal> searchPrincipals(String pattern)
                                      throws ClientException
Deprecated. see searchUsers(String)

Throws:
ClientException

searchGroups

DocumentModelList searchGroups(String pattern)
                               throws ClientException
Search matching groups through their defined search fields

Throws:
ClientException
Since:
5.4.3

getUserIds

List<String> getUserIds()
                        throws ClientException
Returns the list of all user ids.

Throws:
ClientException
Since:
5.2M4

createUser

DocumentModel createUser(DocumentModel userModel)
                         throws ClientException,
                                UserAlreadyExistsException
Creates user from given model.

Throws:
ClientException
UserAlreadyExistsException
Since:
5.2M4

updateUser

void updateUser(DocumentModel userModel)
                throws ClientException
Updates user represented by given model.

Parameters:
userModel -
Throws:
ClientException
Since:
5.2M4

deleteUser

void deleteUser(DocumentModel userModel)
                throws ClientException
Deletes user represented by given model.

Throws:
DirectoryException - if given entry does not exist
ClientException
Since:
5.2M4

deleteUser

void deleteUser(String userId)
                throws ClientException
Deletes user with given id.

Throws:
DirectoryException - if given entry does not exist
ClientException
Since:
5.2M4

getBareUserModel

DocumentModel getBareUserModel()
                               throws ClientException
Returns a bare user model.

Can be used for user creation/search screens.

Throws:
ClientException
Since:
5.2M4

getUserModel

DocumentModel getUserModel(String userName)
                           throws ClientException
Returns the document model representing user with given id or null if it does not exist.

Throws:
ClientException
Since:
5.2M4

searchUsers

DocumentModelList searchUsers(String pattern)
                              throws ClientException
Returns users matching given pattern

Pattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).

Throws:
ClientException
Since:
5.2M4

searchUsers

DocumentModelList searchUsers(Map<String,Serializable> filter,
                              Set<String> fulltext)
                              throws ClientException
Returns users matching given criteria.

Parameters:
filter - filter with field names as keys
fulltext - field names used for fulltext match
Throws:
ClientException
Since:
5.2M4

getUserListingMode

String getUserListingMode()
                          throws ClientException
Throws:
ClientException

getUserSortField

String getUserSortField()
                        throws ClientException
Throws:
ClientException

getUserPasswordPattern

Pattern getUserPasswordPattern()
                               throws ClientException
Throws:
ClientException

getGroupIds

List<String> getGroupIds()
                         throws ClientException
Returns the list of all groups ids.

Throws:
ClientException
Since:
5.2M4

searchGroups

DocumentModelList searchGroups(Map<String,Serializable> filter,
                               Set<String> fulltext)
                               throws ClientException
Returns groups matching given criteria.

Parameters:
filter - filter with field names as keys
fulltext - field names used for fulltext match
Throws:
ClientException
Since:
5.2M4

createGroup

DocumentModel createGroup(DocumentModel groupModel)
                          throws ClientException,
                                 GroupAlreadyExistsException
Creates a group from given model

Returns:
the created group model
Throws:
ClientException
GroupAlreadyExistsException
Since:
5.2M4

updateGroup

void updateGroup(DocumentModel groupModel)
                 throws ClientException
Updates group represented by given model.

Throws:
DirectoryException - if given entry does not exist
ClientException
Since:
5.2M4

deleteGroup

void deleteGroup(DocumentModel groupModel)
                 throws ClientException
Deletes group represented by given model.

Parameters:
groupModel -
Throws:
DirectoryException - if given entry does not exist
ClientException
Since:
5.2M4

deleteGroup

void deleteGroup(String groupId)
                 throws ClientException
Deletes group with given id.

Parameters:
groupId -
Throws:
DirectoryException - if given entry does not exist
ClientException
Since:
5.2M4

getBareGroupModel

DocumentModel getBareGroupModel()
                                throws ClientException
Returns a bare group model.

Can be used for group creation/search screens.

Throws:
ClientException
Since:
5.2M4

getGroupModel

DocumentModel getGroupModel(String groupName)
                            throws ClientException
Return the group document model with this id or null if group does not exist.

Parameters:
groupName - the group identifier
Throws:
ClientException
Since:
5.2M4

getDefaultGroup

String getDefaultGroup()

getGroupListingMode

String getGroupListingMode()
                           throws ClientException
Throws:
ClientException

getGroupsInGroup

List<String> getGroupsInGroup(String parentId)
                              throws ClientException
Returns the list of groups that belong to this group.

Parameters:
parentId - the name of the parent group.
Returns:
Throws:
ClientException

getTopLevelGroups

List<String> getTopLevelGroups()
                               throws ClientException
Returns the list of groups that are not members of other groups.

Returns:
Throws:
ClientException

getUsersInGroup

List<String> getUsersInGroup(String groupId)
                             throws ClientException
Returns the list of users that belong to this group.

Parameters:
groupId - ID of the group
Returns:
Throws:
ClientException

getUsersInGroupAndSubGroups

List<String> getUsersInGroupAndSubGroups(String groupId)
                                         throws ClientException
Get users from a group and its subgroups.

Parameters:
groupId - ID of the group
Returns:
Throws:
ClientException

areGroupsReadOnly

Boolean areGroupsReadOnly()
                          throws ClientException
Returns true is users referential is read only (ie : LDAP) -> can not add users -> can not delete users.

Throws:
ClientException

areUsersReadOnly

Boolean areUsersReadOnly()
                         throws ClientException
Returns true is groups referential is read only (ie : LDAP) -> can not add groups -> can not delete groups.

Throws:
ClientException

getUserDirectoryName

String getUserDirectoryName()
                            throws ClientException
Gets the user directory name.

Returns:
the user directory name.
Throws:
ClientException

getUserSchemaName

String getUserSchemaName()
                         throws ClientException
Returns the user directory schema name.

Throws:
ClientException
Since:
5.2M4

getUserIdField

String getUserIdField()
                      throws ClientException
Returns the user directory id field.

Throws:
ClientException
Since:
5.2M4

getUserEmailField

String getUserEmailField()
                         throws ClientException
Gets the user email field.

Returns:
the user email field.
Throws:
ClientException

getUserSearchFields

Set<String> getUserSearchFields()
                                throws ClientException
Gets the user search fields, the fields to use when a principal search is done.

Returns:
the search fields.
Throws:
ClientException

getGroupSearchFields

Set<String> getGroupSearchFields()
                                 throws ClientException
Gets the group search fields.

Throws:
ClientException

getGroupDirectoryName

String getGroupDirectoryName()
                             throws ClientException
Gets the group directory name.

Returns:
the group directory name.
Throws:
ClientException

getGroupSchemaName

String getGroupSchemaName()
                          throws ClientException
Returns the group directory schema name.

Throws:
ClientException
Since:
5.2M4

getGroupIdField

String getGroupIdField()
                       throws ClientException
Returns the group directory id field.

Throws:
ClientException
Since:
5.2M4

getGroupLabelField

String getGroupLabelField()
                          throws ClientException
Returns the group label field.

Throws:
ClientException
Since:
5.4.3

getGroupMembersField

String getGroupMembersField()
                            throws ClientException
Gets the group members field.

Returns:
the group members field.
Throws:
ClientException

getGroupSubGroupsField

String getGroupSubGroupsField()
                              throws ClientException
Gets the group sub-groups field.

Returns:
the sub-groups field.
Throws:
ClientException

getGroupParentGroupsField

String getGroupParentGroupsField()
                                 throws ClientException
Gets the group parent-groups field.

Returns:
the parent-groups field.
Throws:
ClientException

getAnonymousUserId

String getAnonymousUserId()
                          throws ClientException
Gets the anonymous user id.

Returns:
the anonymous user id, or the default one if none is defined.
Throws:
ClientException

getDigestAuthDirectory

String getDigestAuthDirectory()
                              throws ClientException
Gets the Digest Auth directory.

Throws:
ClientException

getDigestAuthRealm

String getDigestAuthRealm()
                          throws ClientException
Gets the Digest Auth realm.

Throws:
ClientException

setConfiguration

void setConfiguration(UserManagerDescriptor descriptor)
                      throws ClientException
Sets the given configuration on the service.

Parameters:
descriptor - the descriptor as parsed from xml, merged from the previous one if it exists.
Throws:
ClientException

getAdministratorsGroups

List<String> getAdministratorsGroups()
Returns the list of administrators groups.

Since:
5.3 GA

getModelForUser

@Deprecated
DocumentModel getModelForUser(String name)
                              throws ClientException
Deprecated. use getUserModel(String)

Throws:
ClientException

getAvailablePrincipals

@Deprecated
List<NuxeoPrincipal> getAvailablePrincipals()
                                            throws ClientException
Deprecated. use getUserIds() or #searchUsers(null)

Throws:
ClientException

createPrincipal

@Deprecated
void createPrincipal(NuxeoPrincipal principal)
                     throws ClientException
Deprecated. use createUser(DocumentModel)

Throws:
ClientException

updatePrincipal

@Deprecated
void updatePrincipal(NuxeoPrincipal principal)
                     throws ClientException
Deprecated. use updateUser(DocumentModel)

Throws:
ClientException

deletePrincipal

@Deprecated
void deletePrincipal(NuxeoPrincipal principal)
                     throws ClientException
Deprecated. use deleteUser(DocumentModel)

Throws:
ClientException

searchByMap

@Deprecated
List<NuxeoPrincipal> searchByMap(Map<String,Serializable> filter,
                                            Set<String> pattern)
                                 throws ClientException
Deprecated. use searchUsers(Map, Set)

Throws:
ClientException

getAvailableGroups

@Deprecated
List<NuxeoGroup> getAvailableGroups()
                                    throws ClientException
Deprecated. use getGroupIds() or searchGroups(Map, Set)

Throws:
ClientException

createGroup

@Deprecated
void createGroup(NuxeoGroup group)
                 throws ClientException
Deprecated. use createGroup(DocumentModel)

Throws:
ClientException

deleteGroup

@Deprecated
void deleteGroup(NuxeoGroup group)
                 throws ClientException
Deprecated. use deleteGroup(DocumentModel)

Throws:
ClientException

updateGroup

@Deprecated
void updateGroup(NuxeoGroup group)
                 throws ClientException
Deprecated. use updateGroup(DocumentModel)

Throws:
ClientException

getUsersForPermission

String[] getUsersForPermission(String perm,
                               ACP acp)
For an ACP, get the list of user that has a permission. This method should be use with care as it can cause performance issues while getting the list of users.

Parameters:
perm - the permission
acp - The access control policy of the document
Returns:
the list of user ids
Since:
5.4.2

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.