public class FakeUserManagerImpl extends Object implements UserManager
UserManager.MatchType| Constructor and Description |
|---|
FakeUserManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
Principal |
authenticate(String name,
String password)
Get a principal object for the given username if the username / password pair is valid, otherwise returns null.
|
boolean |
checkUsernamePassword(String username,
String password)
Check the password for the given username.
|
DocumentModel |
createGroup(DocumentModel groupModel)
Creates a group from given model
|
DocumentModel |
createUser(DocumentModel userModel)
Creates user from given model.
|
void |
deleteGroup(DocumentModel groupModel)
Deletes group represented by given model.
|
void |
deleteGroup(String groupId)
Deletes group with given id.
|
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.
|
List<String> |
getAncestorGroups(String groupId)
Returns the ancestor groups of the group with the given id.
|
String |
getAnonymousUserId()
Gets the anonymous user id.
|
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.
|
GroupConfig |
getGroupConfig()
Returns the contributed
GroupConfig. |
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.
|
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() |
void |
handleEvent(Event event)
An event was received.
|
void |
notifyGroupChanged(String groupName,
String eventId,
List<String> ancestorGroupNames)
Notifies that the given group has changed with the given event:
At the runtime level so that the JaasCacheFlusher listener can make sure the principal cache is reset.
At the core level, passing the
groupName as the "id" property of the fired event.
|
void |
notifyUserChanged(String userName,
String eventId)
Notifies that the given user has changed with the given event:
At the runtime level so that the JaasCacheFlusher listener can make sure the principal cache is reset.
At the core level, passing the
userName as the "id" property of the fired event.
|
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) |
DocumentModelList |
searchUsers(Map<String,Serializable> filter,
Set<String> fulltext)
Returns users matching given criteria.
|
DocumentModelList |
searchUsers(String pattern)
Returns users matching given pattern
|
void |
setAnonymousUser(VirtualUser anonymousUser) |
void |
setConfiguration(UserManagerDescriptor descriptor)
Sets the given configuration on the service.
|
void |
setDefaultGroup(String defaultGroup) |
void |
setGroupDirectoryName(String groupDirectoryName) |
void |
setGroupListingMode(String groupListingMode) |
void |
setGroupMembersField(String groupMembersField) |
void |
setGroupParentGroupsField(String groupParentGroupsField) |
void |
setGroupSortField(String sortField) |
void |
setGroupSubGroupsField(String groupSubGroupsField) |
void |
setUserDirectoryName(String userDirectoryName) |
void |
setUserEmailField(String userEmailField) |
void |
setUserListingMode(String userListingMode) |
void |
setUserPasswordPattern(Pattern userPasswordPattern) |
void |
setUserSearchFields(Map<String,UserManager.MatchType> userSearchFields) |
void |
setUserSearchFields(Set<String> userSearchFields) |
void |
setUserSortField(String sortField) |
void |
setVirtualUsers(Map<String,VirtualUserDescriptor> virtualUsers) |
void |
updateGroup(DocumentModel groupModel)
Updates group represented by given model.
|
void |
updateUser(DocumentModel userModel)
Updates user represented by given model.
|
boolean |
validatePassword(String password) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnotifyGroupChangedpublic FakeUserManagerImpl()
public String getUserListingMode()
getUserListingMode in interface UserManagerpublic void setUserListingMode(String userListingMode)
public String getGroupListingMode()
getGroupListingMode in interface UserManagerpublic void setGroupListingMode(String groupListingMode)
public String getDefaultGroup()
getDefaultGroup in interface UserManagerpublic void setDefaultGroup(String defaultGroup)
public String getUserSortField()
getUserSortField in interface UserManagerpublic void setUserSortField(String sortField)
public void setGroupSortField(String sortField)
public void setUserDirectoryName(String userDirectoryName)
public String getUserDirectoryName()
UserManagergetUserDirectoryName in interface UserManagerpublic void setUserEmailField(String userEmailField)
public String getUserEmailField()
UserManagergetUserEmailField in interface UserManagerpublic void setUserSearchFields(Set<String> userSearchFields)
public void setUserSearchFields(Map<String,UserManager.MatchType> userSearchFields)
public Set<String> getUserSearchFields()
UserManagergetUserSearchFields in interface UserManagerpublic Set<String> getGroupSearchFields()
UserManagergetGroupSearchFields in interface UserManagerpublic void setGroupDirectoryName(String groupDirectoryName)
public String getGroupDirectoryName()
UserManagergetGroupDirectoryName in interface UserManagerpublic void setGroupMembersField(String groupMembersField)
public String getGroupMembersField()
UserManagergetGroupMembersField in interface UserManagerpublic void setGroupSubGroupsField(String groupSubGroupsField)
public String getGroupSubGroupsField()
UserManagergetGroupSubGroupsField in interface UserManagerpublic void setGroupParentGroupsField(String groupParentGroupsField)
public String getGroupParentGroupsField()
UserManagergetGroupParentGroupsField in interface UserManagerpublic Boolean areGroupsReadOnly()
UserManagerareGroupsReadOnly in interface UserManagerpublic Boolean areUsersReadOnly()
UserManagerareUsersReadOnly in interface UserManagerpublic boolean checkUsernamePassword(String username, String password)
AuthenticatorcheckUsernamePassword in interface UserManagercheckUsernamePassword in interface Authenticatorusername - the usernamepassword - the password to checkpublic boolean validatePassword(String password)
validatePassword in interface UserManagerpublic List<String> getGroupsInGroup(String parentId)
UserManagergetGroupsInGroup in interface UserManagerparentId - the name of the parent group.public NuxeoPrincipal getPrincipal(String username)
UserManagerCan build principals for anonymous and virtual users as well as for users defined in the users directory.
getPrincipal in interface UserManagerpublic List<String> getTopLevelGroups()
UserManagergetTopLevelGroups in interface UserManagerpublic List<String> getUsersInGroup(String groupId)
UserManagergetUsersInGroup in interface UserManagergroupId - ID of the grouppublic List<String> getUsersInGroupAndSubGroups(String groupId)
UserManagergetUsersInGroupAndSubGroups in interface UserManagergroupId - ID of the grouppublic DocumentModelList searchGroups(String pattern)
UserManagersearchGroups in interface UserManagerpublic List<NuxeoPrincipal> searchPrincipals(String pattern)
searchPrincipals in interface UserManagerpublic Pattern getUserPasswordPattern()
getUserPasswordPattern in interface UserManagerpublic void setUserPasswordPattern(Pattern userPasswordPattern)
public void setAnonymousUser(VirtualUser anonymousUser)
public void setVirtualUsers(Map<String,VirtualUserDescriptor> virtualUsers)
public String getAnonymousUserId()
UserManagergetAnonymousUserId in interface UserManagerpublic String getDigestAuthDirectory()
UserManagergetDigestAuthDirectory in interface UserManagerpublic String getDigestAuthRealm()
UserManagergetDigestAuthRealm in interface UserManagerpublic void setConfiguration(UserManagerDescriptor descriptor)
UserManagersetConfiguration in interface UserManagerdescriptor - the descriptor as parsed from xml, merged from the previous one if it exists.public DocumentModel getBareUserModel()
UserManagerCan be used for user creation/search screens.
getBareUserModel in interface UserManagerpublic DocumentModel createGroup(DocumentModel groupModel)
UserManagercreateGroup in interface UserManagerpublic DocumentModel createUser(DocumentModel userModel)
UserManagercreateUser in interface UserManagerpublic void deleteGroup(DocumentModel groupModel)
UserManagerdeleteGroup in interface UserManagerpublic void deleteGroup(String groupId)
UserManagerdeleteGroup in interface UserManagerpublic void deleteUser(DocumentModel userModel)
UserManagerdeleteUser in interface UserManagerpublic void deleteUser(String userId)
UserManagerdeleteUser in interface UserManagerpublic DocumentModel getBareGroupModel()
UserManagerCan be used for group creation/search screens.
getBareGroupModel in interface UserManagerpublic NuxeoGroup getGroup(String groupName)
UserManagergetGroup in interface UserManagerpublic List<String> getGroupIds()
UserManagergetGroupIds in interface UserManagerpublic List<String> getUserIds()
UserManagergetUserIds in interface UserManagerpublic DocumentModelList searchGroups(Map<String,Serializable> filter, Set<String> fulltext)
UserManagersearchGroups in interface UserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchpublic DocumentModelList searchUsers(Map<String,Serializable> filter, Set<String> fulltext)
UserManagersearchUsers in interface UserManagerfilter - filter with field names as keysfulltext - field names used for fulltext matchpublic DocumentModelList searchUsers(String pattern)
UserManagerPattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).
searchUsers in interface UserManagerpublic void updateGroup(DocumentModel groupModel)
UserManagerupdateGroup in interface UserManagerpublic void updateUser(DocumentModel userModel)
UserManagerupdateUser in interface UserManagerpublic DocumentModel getGroupModel(String groupName)
UserManagergetGroupModel in interface UserManagergroupName - the group identifierpublic DocumentModel getUserModel(String userName)
UserManagergetUserModel in interface UserManagerpublic String getGroupIdField()
UserManagergetGroupIdField in interface UserManagerpublic String getGroupLabelField()
UserManagergetGroupLabelField in interface UserManagerpublic String getGroupSchemaName()
UserManagergetGroupSchemaName in interface UserManagerpublic String getUserIdField()
UserManagergetUserIdField in interface UserManagerpublic String getUserSchemaName()
UserManagergetUserSchemaName in interface UserManagerpublic List<String> getAdministratorsGroups()
UserManagergetAdministratorsGroups in interface UserManagerpublic String[] getUsersForPermission(String perm, ACP acp)
UserManagergetUsersForPermission in interface UserManagerperm - the permissionacp - The access control policy of the documentpublic Principal authenticate(String name, String password)
AuthenticatorThis method is doing the authentication of the given username / password pair and returns the corresponding principal object if authentication succeeded otherwise returns null.
authenticate in interface Authenticatorpublic void handleEvent(Event event)
EventListenerhandleEvent in interface EventListenerpublic List<String> getAncestorGroups(String groupId)
UserManagergetAncestorGroups in interface UserManagerpublic GroupConfig getGroupConfig()
UserManagerGroupConfig.getGroupConfig in interface UserManagerpublic void notifyUserChanged(String userName, String eventId)
UserManageruserName as the "id" property of the fired event.notifyUserChanged in interface UserManagerpublic void notifyGroupChanged(String groupName, String eventId, List<String> ancestorGroupNames)
UserManagergroupName as the "id" property of the fired event.
The ancestorGroupNames list must contain the ancestor groups of the given group. It can be computed by
calling UserManager.getAncestorGroups(String). It will be passed as the "ancestorGroups" property of the
fired core event.
notifyGroupChanged in interface UserManagerCopyright © 2018 Nuxeo. All rights reserved.