Class UserManagerServiceImpl
java.lang.Object
net.datenwerke.treedb.service.treedb.TreeDBManagerImpl<AbstractUserManagerNode>
net.datenwerke.security.service.treedb.LoggedTreeDbManagerImpl<AbstractUserManagerNode>
net.datenwerke.security.service.treedb.SecuredTreeDBManagerImpl<AbstractUserManagerNode>
net.datenwerke.security.service.usermanager.UserManagerServiceImpl
- All Implemented Interfaces:
UserManagerService,TreeDBManager<AbstractUserManagerNode>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
public class UserManagerServiceImpl
extends SecuredTreeDBManagerImpl<AbstractUserManagerNode>
implements UserManagerService
ReportServer's User Management Component
-
Field Summary
Fields inherited from interface net.datenwerke.security.service.usermanager.UserManagerService
MODULE_NAME, SECUREE_ID -
Constructor Summary
ConstructorsConstructorDescriptionUserManagerServiceImpl(TreeDBService treeDB, <any> entityManagerProvider, PasswordHasher passwordHasher, HookHandlerService hookHandlerService) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassword(String username, String oldPassword, String newPassword) voidchangePassword(User user, String oldPassword, String newPassword) voidRemoves the node and takes care of database constraints.Returns aCollectionof all existingGroupsReturns all users underneath the node.Returns aCollectionof all existingUsersgetDirectGroups(User user) Returns groups in which the user is a direct member.getGroupByName(String name) Finds aGroupby namegetGroups(Collection<Long> ids) getGroupsWithMember(Group group) getIndirectGroups(User user) Returns groups in which the user is an indirect member.getNodeById(long id) Searches for aAbstractUserManagerNodeby its idgetNodeByKey(String key) longReturns the number of active users in the system, that is, not inhibited and not with accounts not expired.longlonggetOUs(Collection<Long> ids) getOUsByName(String name) Searches for aOrganisationalUnitby its namegetReferencedGroups(User user) Returns all groups in which the user is a direct or indirect member.getRoots()getUserByMail(String email) Finds aUserby emailgetUserByName(String name) Finds aUserby namegetUserOrNull(String username) getUsers(Collection<Long> ids) getUsers(Collection<Long> ids, boolean dereferenceGroups) ReturnsUserobjects for all given IDs (be they user or group)getUsersByMail(String email) voidRemoves the node and takes care of database constraints.voidsetPassword(User user, String newPassword) Sets theUsers passwordbooleanuserInFolk(User user, AbstractUserManagerNode folk) Tests whether the submittedUseris part of the folk.booleanuserInFolk(User user, AbstractUserManagerNode folk, Set<Group> seenGroups) Methods inherited from class net.datenwerke.security.service.treedb.SecuredTreeDBManagerImpl
copy, getVirtualRoots, move, move, move, move, persistMethods inherited from class net.datenwerke.security.service.treedb.LoggedTreeDbManagerImpl
mergeMethods inherited from class net.datenwerke.treedb.service.treedb.TreeDBManagerImpl
allowsMultipleRoots, copy, getBaseType, getChildrenWithName, isFolder, updateFlagsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.datenwerke.treedb.service.treedb.TreeDBManager
allowsMultipleRoots, copy, getBaseType, getChildrenWithName, getVirtualRoots, isFolder, move, move, updateFlagsMethods inherited from interface net.datenwerke.security.service.usermanager.UserManagerService
merge, persist
-
Constructor Details
-
Method Details
-
getUserByName
Description copied from interface:UserManagerServiceFinds aUserby name- Specified by:
getUserByNamein interfaceUserManagerService- Parameters:
name- TheUser's name- Returns:
- The corresponding
User
-
getUsersByMail
- Specified by:
getUsersByMailin interfaceUserManagerService
-
getUserByMail
Description copied from interface:UserManagerServiceFinds aUserby email- Specified by:
getUserByMailin interfaceUserManagerService- Returns:
- The corresponding
User
-
getGroupByName
Description copied from interface:UserManagerServiceFinds aGroupby name- Specified by:
getGroupByNamein interfaceUserManagerService- Parameters:
name- TheGroup's name- Returns:
- The corresponding
Group
-
getOUsByName
Description copied from interface:UserManagerServiceSearches for aOrganisationalUnitby its name- Specified by:
getOUsByNamein interfaceUserManagerService- Parameters:
name- The name of theOrganisationalUnit- Returns:
- The corresponding
OrganisationalUnit
-
remove
Removes the node and takes care of database constraints.- Specified by:
removein interfaceTreeDBManager<AbstractUserManagerNode>- Specified by:
removein interfaceUserManagerService- Overrides:
removein classSecuredTreeDBManagerImpl<AbstractUserManagerNode>- Parameters:
node-AbstractUserManagerNode
-
forceRemove
Removes the node and takes care of database constraints.- Specified by:
forceRemovein interfaceTreeDBManager<AbstractUserManagerNode>- Overrides:
forceRemovein classSecuredTreeDBManagerImpl<AbstractUserManagerNode>
-
getGroupsWithMember
@QueryByAttribute(where=<error>, type=IS_MEMBER) public List<Group> getGroupsWithMember(Group group) - Specified by:
getGroupsWithMemberin interfaceUserManagerService
-
getGroupsWithMember
@QueryByAttribute(where=<error>, type=IS_MEMBER) public List<Group> getGroupsWithMember(OrganisationalUnit ou) - Specified by:
getGroupsWithMemberin interfaceUserManagerService
-
userInFolk
Description copied from interface:UserManagerServiceTests whether the submittedUseris part of the folk.- Specified by:
userInFolkin interfaceUserManagerService- Parameters:
user- TheUserto testfolk- TheAbstractUserManagerNode(the folk)- Returns:
- true if the
Useris part of folk; false otherwise
-
userInFolk
-
getReferencedGroups
Description copied from interface:UserManagerServiceReturns all groups in which the user is a direct or indirect member.- Specified by:
getReferencedGroupsin interfaceUserManagerService- Parameters:
user- the user to fetch all groups from
-
getAllGroups
Description copied from interface:UserManagerServiceReturns aCollectionof all existingGroups- Specified by:
getAllGroupsin interfaceUserManagerService- Returns:
- A
CollectionofGroups
-
getAllOUs
- Specified by:
getAllOUsin interfaceUserManagerService
-
getAllUsers
Description copied from interface:UserManagerServiceReturns aCollectionof all existingUsers- Specified by:
getAllUsersin interfaceUserManagerService- Returns:
- A
CollectionofUsers
-
getUsers
Description copied from interface:UserManagerService- Specified by:
getUsersin interfaceUserManagerService- Parameters:
ids- ACollectionofLongs- Returns:
- A
SetofUsers
-
getUsers
Description copied from interface:UserManagerServiceReturnsUserobjects for all given IDs (be they user or group)- Specified by:
getUsersin interfaceUserManagerService- Parameters:
ids- ACollectionofLongs containing the IDsdereferenceGroups- Set to true if the result should contain groups- Returns:
- A
SetofUsers
-
getGroups
Description copied from interface:UserManagerService- Specified by:
getGroupsin interfaceUserManagerService- Parameters:
ids- ACollectionofLongs- Returns:
- A
SetofGroups
-
setPassword
Description copied from interface:UserManagerServiceSets theUsers password- Specified by:
setPasswordin interfaceUserManagerService- Parameters:
user- TheUsernewPassword- The new password
-
changePassword
public void changePassword(User user, String oldPassword, String newPassword) throws ExpectedException - Specified by:
changePasswordin interfaceUserManagerService- Throws:
ExpectedException
-
changePassword
public void changePassword(String username, String oldPassword, String newPassword) throws ExpectedException - Specified by:
changePasswordin interfaceUserManagerService- Throws:
ExpectedException
-
getRoots
- Specified by:
getRootsin interfaceTreeDBManager<AbstractUserManagerNode>
-
getAllNodes
- Specified by:
getAllNodesin interfaceTreeDBManager<AbstractUserManagerNode>
-
getNodeById
Description copied from interface:UserManagerServiceSearches for aAbstractUserManagerNodeby its id- Specified by:
getNodeByIdin interfaceTreeDBManager<AbstractUserManagerNode>- Specified by:
getNodeByIdin interfaceUserManagerService- Parameters:
id- The ID- Returns:
- The
AbstractUserManagerNodeidentified by the given ID
-
getAllTransitiveUsers
Description copied from interface:UserManagerServiceReturns all users underneath the node.- Specified by:
getAllTransitiveUsersin interfaceUserManagerService- Parameters:
node-
-
getOUs
- Specified by:
getOUsin interfaceUserManagerService
-
getDirectGroups
Description copied from interface:UserManagerServiceReturns groups in which the user is a direct member.- Specified by:
getDirectGroupsin interfaceUserManagerService- Parameters:
user- the user to fetch direct groups from
-
getIndirectGroups
Description copied from interface:UserManagerServiceReturns groups in which the user is an indirect member.- Specified by:
getIndirectGroupsin interfaceUserManagerService- Parameters:
user- the user to fetch indirect groups from
-
getUserOrNull
- Specified by:
getUserOrNullin interfaceUserManagerService
-
getNumberOfActiveUsers
public long getNumberOfActiveUsers()Description copied from interface:UserManagerServiceReturns the number of active users in the system, that is, not inhibited and not with accounts not expired.- Specified by:
getNumberOfActiveUsersin interfaceUserManagerService- Returns:
-
getNumberOfInhibitedUsers
public long getNumberOfInhibitedUsers()- Specified by:
getNumberOfInhibitedUsersin interfaceUserManagerService
-
getNumberOfExpiredUsers
public long getNumberOfExpiredUsers()- Specified by:
getNumberOfExpiredUsersin interfaceUserManagerService
-
getNodeByKey
- Specified by:
getNodeByKeyin interfaceTreeDBManager<AbstractUserManagerNode>
-