Package cz.metacentrum.perun.core.impl
Class UsersManagerImpl
java.lang.Object
cz.metacentrum.perun.core.impl.UsersManagerImpl
- All Implemented Interfaces:
UsersManagerImplApi
UsersManager implementation.
- Author:
- Michal Prochazka michalp@ics.muni.cz, Slavek Licehammer glory@ics.muni.cz, Sona Mastrakova
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RowMapper<BlockedLogin> protected static final Stringprotected static final Stringprotected static final RowMapper<UserExtSource> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpecificUserOwner(PerunSession sess, User user, User specificUser) Add specificUser owner (the user).addUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) Adds user's external sources.anonymizeUser(PerunSession sess, User user) Anonymizes users data in DB - sets names and titles to NULL and sets anonymized flag to true.voidblockLogin(PerunSession sess, String login, String namespace, Integer relatedUserId) Block login for given namespace or block login globally (if no namespace is selected)voidcheckPasswordResetRequestIsValid(PerunSession sess, UUID uuid) Checks if the password reset request link is valid.voidcheckReservedLogins(PerunSession sess, String namespace, String login, boolean ignoreCase) Check if login exists in specified namespace or in any namespace (if namespace is null).voidcheckUserExists(PerunSession sess, User user) Check if user exists in underlaying data source.voidcheckUserExtSourceExists(PerunSession sess, UserExtSource userExtSource) Check if userExtSource exists in underlaying data source by identity (login/extSource combination)voidcheckUserExtSourceExistsById(PerunSession sess, int id) Check if userExtSource exists in underlaying data source by its ID.createUser(PerunSession sess, User user) Creates the user, stores it in the DB.voiddeleteReservedLogin(PerunSession sess, Pair<String, String> login) Deletes given login reservations.voiddeleteReservedLoginsForNamespace(PerunSession sess, String namespace) Deletes all reserved logins in given namespacevoiddeleteSponsorLinks(PerunSession sess, User sponsor) Deletes all links to sponsors, even those marked as inactive.voiddeleteUser(PerunSession sess, User user) Deletes user (normal or specific) including all relations to other users (normal,specific,sponsor)voiddeleteUsersApplications(User user) Delete all applications and submitted data for specific user.voidDelete all reserved logins for specific user (pair is namespace and login)voiddisableOwnership(PerunSession sess, User user, User specificUser) Set ownership for user and specificUser to DISABLE (1).voidenableOwnership(PerunSession sess, User user, User specificUser) Set ownership for user and specificUser to ENABLE (0).findUsers(PerunSession sess, String searchString) Returns list of users who matches the searchString, searching name, id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).findUsersByExactMatch(PerunSession sess, String searchString) Returns list of users who matches the searchString, searching name (exact match), id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).findUsersByExactName(PerunSession sess, String searchString) Returns list of users who exactly matches the searchStringfindUsersByName(PerunSession sess, String searchString) Returns list of users who matches the searchStringfindUsersByName(PerunSession sess, String titleBefore, String firstName, String middleName, String lastName, String titleAfter) Returns list of users who matches the fields.findUsersWithExtSourceAttributeValueEnding(PerunSessionImpl sess, String attributeName, String valueEnd, List<String> excludeValueEnds) Implements search for #UsersManagerBl.findUsersWithExtSourceAttributeValueEnding().getActiveUserExtSources(PerunSession sess, User user) Get all users userExtSources with last_access not older than (now - m), where 'm' is number of months defined in CONSTANT in UsersManagerImpl.Returns all blocked logins in namespaces (if namespace is null, then this login is blocked globally)getAllowedResources(PerunSession sess, User user) Return all resources, where user is allowed by all his members.getAllUserExtSourcesByTypeAndLogin(PerunSession sess, String extType, String extLogin) Gets list of all users external sources by specific type and extLogin.getAssignedResources(PerunSession sess, Facility facility, User user) Return all resources of specified facility, where user is assigned through all his members.getAssignedResources(PerunSession sess, User user) Return all resources, where user is assigned through all his members.getAssignedRichResources(PerunSession sess, User user) Return all rich resources, where user is assigned through all his members.getAssociatedResources(PerunSession sess, Facility facility, User user) Return all resources of specified facility with which user is associated through all his members.getAssociatedResources(PerunSession sess, User user) Get all resources with which user can be associated (similar to assigned resources, but does not require ACTIVE group-resource assignment).getBlockedLoginById(PerunSession sess, int id) Get blocked login by idgetBlockedLoginsPage(PerunSession sess, BlockedLoginsPageQuery query) Get page of blocked logins.getGroupsWhereUserIsAdmin(PerunSession sess, User user) Returns list of Groups in Perun, where the User is a direct Administrator or he is a VALID member of any group which is Administrator of some of these Groups.getGroupsWhereUserIsAdmin(PerunSession sess, Vo vo, User user) Returns list of Groups in selected Vo, where the User is a direct Administrator or he is a VALID member of any group which is Administrator of some of these Groups.intgetIdOfBlockedLogin(PerunSession sess, String login, String namespace) Return ID of blocked logingetPasswordManagerModule(PerunSession session, String namespace) Return instance of PasswordManagerModule for specified namespace or NULL if class for module is not found.getPendingPreferredEmailChanges(PerunSession sess, User user) Return list of email addresses of user, which are awaiting validation and are inside time window for validation.getPreferredEmailChangeRequest(PerunSession sess, User user, UUID uuid) Get new preferred email value from user's original requestgetRelatedUserIdByBlockedLoginInNamespace(PerunSession sess, String login, String namespace) Get user id of the user who was related to the given login in the pastgetReservedLoginsByApp(PerunSession sess, int appId) Gets reserved logins which used in the given application.getReservedLoginsOnlyByGivenApp(PerunSession sess, int appId) Gets reserved logins which can be deleted - they are used only in the given application.getSpecificUsers(PerunSession sess) Return all specific Users (only specific users) Return also users who has no owners.getSpecificUsersByUser(PerunSession sess, User user) Return all specificUsers who are owned by the user and their ownership is not in status disabledgetSponsors(PerunSession sess, Member sponsoredMember) Gets list of user that sponsored a member.getSponsorsForSponsoredMembersInVo(PerunSession sess, int voId) Retrieves a map, that maps the ids of the sponsored members in the given VO to a list of their Sponsors with the corresponding Sponsorship objects.getUnanonymizedUsersBySpecificUser(PerunSession sess, User specificUser) Return all users who owns the specificUser and their ownership is not in status disabled and are not anonymizedgetUserById(PerunSession sess, int id) Returns user by its id.getUserByMember(PerunSession sess, Member member) Returns user by VO member.getUserByUserExtSource(PerunSession sess, UserExtSource userExtSource) Returns user by his login in external source.getUserExtSourceByExtLogin(PerunSession sess, ExtSource source, String extLogin) Gets user's external source by the user's external login and external source.getUserExtSourceById(PerunSession sess, int id) Get the user ext source by its id.getUserExtSourceByUniqueAttributeValue(PerunSession sess, int attrId, String uniqueValue) Return userExtSource for specific attribute id and unique value.getUserExtSources(PerunSession sess, User user) Get List of user ext sources by usergetUserExtSourcesByIds(PerunSession sess, List<Integer> ids) Gets user ext sources by their ids.getUsers(PerunSession sess) Returns all users (included specific users).getUsersByAttribute(PerunSession sess, Attribute attribute) Returns all users who have set the attribute with the value.getUsersByAttribute(PerunSession sess, Attribute attribute, boolean ignoreCase) Returns all users who have set the attribute with the value IGNORING CASE in the comparison.getUsersByAttributeValue(PerunSession sess, AttributeDefinition attributeDefinition, String attributeValue) Returns all users who have the attribute with the value. attributeValue is not converted to the attribute type, it is always type of String.getUsersByCoreAttributeValue(PerunSession sess, AttributeDefinition attributeDefinition, String attributeValue) Returns all users who have the core attribute with the value. attributeValue is not converted to the attribute type, it is always type of String.getUsersByExtSourceTypeAndLogin(PerunSession perunSession, String extSourceType, String login) Get all the users who have given type of the ExtSource and login.getUsersByIds(PerunSession sess, List<Integer> usersIds) Gets users by their ids.getUsersBySpecificUser(PerunSession sess, User specificUser) Return all users who owns the specificUser and their ownership is not in status disabledgetUsersByVo(PerunSession sess, Vo vo) Return users which have member in VO.intgetUsersCount(PerunSession sess) Get count of all users.getUsersPage(PerunSession sess, UsersPageQuery query) Get page of users.getUsersReservedLogins(User user) Return list of all reserved logins for specific user (pair is namespace and login)Returns all users who are not member of any VO.getVosWhereUserIsAdmin(PerunSession sess, User user) Returns list of VOs, where the user is an Administrator.getVosWhereUserIsMember(PerunSession sess, User user) Returns list of Vos' ids, where the user is member.booleanisLoginBlocked(PerunSession sess, String login, boolean ignoreCase) Return true if login is blocked (globally - for all namespaces per instance OR for some namespace), false if not.booleanisLoginBlockedForNamespace(PerunSession sess, String login, String namespace, boolean ignoreCase) Return true if login is blocked for given namespace, false if not When the namespace is null, then the method behaves like isLoginBlockedGlobally(), so it checks if the login is blocked globally.booleanisLoginBlockedGlobally(PerunSession sess, String login) Return true if login is blocked globally (for all namespaces per instance - represented by namespace = null), false if not.booleanisLoginReserved(PerunSession sess, String namespace, String login, boolean ignoreCase) Return true if login is already reserved in specified namespace or in any namespace (if namespace is null), false if not.booleanisUserAnonymized(PerunSession sess, User user) Checks whether user has been anonymized or not.booleanisUserPerunAdmin(PerunSession sess, User user) Deprecated.loadPasswordResetRequest(PerunSession sess, UUID uuid) Returns only valid password reset request with specified UUID.voidremoveAllAuthorships(PerunSession sess, User user) Removes all authorships of user when user is deleted from DB (author records on all his publications).voidremoveAllPasswordResetRequests(PerunSession sess, User user) Removes all password reset requests associated with user.voidremoveAllPreferredEmailChangeRequests(PerunSession sess, User user) Removes all mail change requests related to user.voidremoveAllUserExtSources(PerunSession sess, User user) Removes all user's external sources.voidremoveSpecificUserOwner(PerunSession sess, User user, User specificUser) Remove specificUser owner (the user) Only disable ownership of user and specificUservoidremoveUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) Removes user's external sources.requestPreferredEmailChange(PerunSession sess, User user, String email) Store request of change of user's preferred email address.searchForUsers(PerunSession sess, String searchString) Similarity substring search in all users based on fullname, ID and attributes defined in perun.propertiessetSpecificUserType(PerunSession sess, User user, SpecificUserType specificUserType) Set flag for specific user type for the user.booleanspecificUserOwnershipExists(PerunSession sess, User user, User specificUser) Return true if ownership between user and specificUser already exists.voidunblockLogin(PerunSession sess, String login, String namespace) Unblock login for given namespace or unblock login globally (if no namespace is selected)voidunblockLoginsById(PerunSession sess, List<Integer> loginIds) Unblock logins by id globally, or in the namespace they were initially blocked.voidunblockLoginsForNamespace(PerunSession sess, String namespace) Unblock all logins for given namespaceunsetSpecificUserType(PerunSession sess, User user, SpecificUserType specificUserType) Unset flag for specific user type for the user.updateNameTitles(PerunSession sess, User user) Updates titles before/after users name.updateUser(PerunSession sess, User user) Updates users data in DB.updateUserExtSource(PerunSession sess, UserExtSource userExtSource) Updates user;s userExtSource in DB.voidupdateUserExtSourceLastAccess(PerunSession sess, UserExtSource userExtSource) Updates user's userExtSource last access time in DB.booleanuserExists(PerunSession sess, User user) Check if user exists in underlaying data source.booleanuserExtSourceExists(PerunSession sess, UserExtSource userExtSource) Check if userExtSource exists in underlaying data source.
-
Field Details
-
BLOCKED_LOGINS_MAPPER
-
USER_MAPPING_SELECT_QUERY
- See Also:
-
USER_EXT_SOURCE_MAPPING_SELECT_QUERY
- See Also:
-
USER_MAPPER
-
USEREXTSOURCE_MAPPER
-
-
Constructor Details
-
UsersManagerImpl
Constructor.- Parameters:
perunPool- connection pool
-
-
Method Details
-
addSpecificUserOwner
Description copied from interface:UsersManagerImplApiAdd specificUser owner (the user). If not exists, create new ownership. If exists, only enable ownership for user and specificUser- Specified by:
addSpecificUserOwnerin interfaceUsersManagerImplApi- Parameters:
sess-user- the userspecificUser- the specificUser
-
addUserExtSource
Description copied from interface:UsersManagerImplApiAdds user's external sources.- Specified by:
addUserExtSourcein interfaceUsersManagerImplApi- Parameters:
sess-user-userExtSource-- Returns:
- user external source with userExtSource.id filled
-
anonymizeUser
Description copied from interface:UsersManagerImplApiAnonymizes users data in DB - sets names and titles to NULL and sets anonymized flag to true.- Specified by:
anonymizeUserin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- user
-
blockLogin
public void blockLogin(PerunSession sess, String login, String namespace, Integer relatedUserId) throws LoginIsAlreadyBlockedException Description copied from interface:UsersManagerImplApiBlock login for given namespace or block login globally (if no namespace is selected)- Specified by:
blockLoginin interfaceUsersManagerImplApi- Parameters:
sess-login- login to be blockednamespace- namespace where the login should be blocked (null means block the login globally)relatedUserId- id of the user related to the login or null if the relatedUserId should not be stored- Throws:
LoginIsAlreadyBlockedException
-
checkPasswordResetRequestIsValid
public void checkPasswordResetRequestIsValid(PerunSession sess, UUID uuid) throws PasswordResetLinkExpiredException, PasswordResetLinkNotValidException Description copied from interface:UsersManagerImplApiChecks if the password reset request link is valid. The request is valid, if it was created, never used and hasn't expired yet.- Specified by:
checkPasswordResetRequestIsValidin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuuid- UUID of the request to check- Throws:
PasswordResetLinkExpiredException- when the password reset request expiredPasswordResetLinkNotValidException- when the password reset request was already used or has never existed
-
checkReservedLogins
public void checkReservedLogins(PerunSession sess, String namespace, String login, boolean ignoreCase) throws AlreadyReservedLoginException Description copied from interface:UsersManagerImplApiCheck if login exists in specified namespace or in any namespace (if namespace is null).- Specified by:
checkReservedLoginsin interfaceUsersManagerImplApi- Parameters:
sess-namespace- namespace for login, null for all namespacelogin- login to checkignoreCase- TRUE to perform case-insensitive check- Throws:
AlreadyReservedLoginException- throw this exception if login already exist in table of reserved logins
-
checkUserExists
Description copied from interface:UsersManagerImplApiCheck if user exists in underlaying data source.- Specified by:
checkUserExistsin interfaceUsersManagerImplApi- Parameters:
sess-user-- Throws:
UserNotExistsException
-
checkUserExtSourceExists
public void checkUserExtSourceExists(PerunSession sess, UserExtSource userExtSource) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerImplApiCheck if userExtSource exists in underlaying data source by identity (login/extSource combination)- Specified by:
checkUserExtSourceExistsin interfaceUsersManagerImplApi- Parameters:
sess-userExtSource-- Throws:
UserExtSourceNotExistsException
-
checkUserExtSourceExistsById
public void checkUserExtSourceExistsById(PerunSession sess, int id) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerImplApiCheck if userExtSource exists in underlaying data source by its ID.- Specified by:
checkUserExtSourceExistsByIdin interfaceUsersManagerImplApi- Parameters:
sess-id-- Throws:
UserExtSourceNotExistsException
-
createUser
Description copied from interface:UsersManagerImplApiCreates the user, stores it in the DB. This method will fill id and uuid to the given user object, but returns a new user object loaded from the DB.- Specified by:
createUserin interfaceUsersManagerImplApi- Parameters:
sess-user- user bean with filled properties- Returns:
- user with user.id filled
-
deleteReservedLogin
Description copied from interface:UsersManagerImplApiDeletes given login reservations.Reserved logins must be removed from external systems (e.g. KDC) BEFORE calling this method via deletePassword() in UsersManager.
- Specified by:
deleteReservedLoginin interfaceUsersManagerImplApi- Parameters:
sess-login- login (pair namespace and login) to delete
-
deleteReservedLoginsForNamespace
Description copied from interface:UsersManagerImplApiDeletes all reserved logins in given namespace- Specified by:
deleteReservedLoginsForNamespacein interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionnamespace- Namespace
-
deleteSponsorLinks
Description copied from interface:UsersManagerImplApiDeletes all links to sponsors, even those marked as inactive.- Specified by:
deleteSponsorLinksin interfaceUsersManagerImplApi- Parameters:
sess- perun sessionsponsor- sponsor
-
deleteUser
public void deleteUser(PerunSession sess, User user) throws UserAlreadyRemovedException, SpecificUserAlreadyRemovedException Description copied from interface:UsersManagerImplApiDeletes user (normal or specific) including all relations to other users (normal,specific,sponsor)- Specified by:
deleteUserin interfaceUsersManagerImplApi- Parameters:
sess- Session for authzuser- User to delete- Throws:
UserAlreadyRemovedException- When user is already deletedSpecificUserAlreadyRemovedException- When specific user is already deleted
-
deleteUsersApplications
Description copied from interface:UsersManagerImplApiDelete all applications and submitted data for specific user.- Specified by:
deleteUsersApplicationsin interfaceUsersManagerImplApi- Parameters:
user- for which delete applications and submitted data
-
deleteUsersReservedLogins
Description copied from interface:UsersManagerImplApiDelete all reserved logins for specific user (pair is namespace and login)- Specified by:
deleteUsersReservedLoginsin interfaceUsersManagerImplApi- Parameters:
user- for which get delete reserved logins
-
disableOwnership
Description copied from interface:UsersManagerImplApiSet ownership for user and specificUser to DISABLE (1).- Specified by:
disableOwnershipin interfaceUsersManagerImplApi- Parameters:
sess-user-specificUser-
-
enableOwnership
Description copied from interface:UsersManagerImplApiSet ownership for user and specificUser to ENABLE (0).- Specified by:
enableOwnershipin interfaceUsersManagerImplApi- Parameters:
sess-user-specificUser-
-
findUsers
Description copied from interface:UsersManagerImplApiReturns list of users who matches the searchString, searching name, id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).- Specified by:
findUsersin interfaceUsersManagerImplApi- Parameters:
sess- perun sessionsearchString- it will be looking for this search string in the specific parameters in DB- Returns:
- list of users
-
findUsersByExactMatch
Description copied from interface:UsersManagerImplApiReturns list of users who matches the searchString, searching name (exact match), id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).- Specified by:
findUsersByExactMatchin interfaceUsersManagerImplApi- Parameters:
sess- perun sessionsearchString- it will be looking for this search string in the specific parameters in DB- Returns:
- list of users
-
findUsersByExactName
Description copied from interface:UsersManagerImplApiReturns list of users who exactly matches the searchString- Specified by:
findUsersByExactNamein interfaceUsersManagerImplApi- Parameters:
sess-searchString-- Returns:
- list of users
-
findUsersByName
Description copied from interface:UsersManagerImplApiReturns list of users who matches the searchString- Specified by:
findUsersByNamein interfaceUsersManagerImplApi- Parameters:
sess-searchString-- Returns:
- list of users
-
findUsersByName
public List<User> findUsersByName(PerunSession sess, String titleBefore, String firstName, String middleName, String lastName, String titleAfter) Description copied from interface:UsersManagerImplApiReturns list of users who matches the fields.- Specified by:
findUsersByNamein interfaceUsersManagerImplApi- Parameters:
sess-titleBefore-firstName-middleName-lastName-titleAfter-- Returns:
- list of users
-
findUsersWithExtSourceAttributeValueEnding
public List<User> findUsersWithExtSourceAttributeValueEnding(PerunSessionImpl sess, String attributeName, String valueEnd, List<String> excludeValueEnds) Description copied from interface:UsersManagerImplApiImplements search for #UsersManagerBl.findUsersWithExtSourceAttributeValueEnding().- Specified by:
findUsersWithExtSourceAttributeValueEndingin interfaceUsersManagerImplApi
-
getActiveUserExtSources
Description copied from interface:UsersManagerImplApiGet all users userExtSources with last_access not older than (now - m), where 'm' is number of months defined in CONSTANT in UsersManagerImpl.- Specified by:
getActiveUserExtSourcesin interfaceUsersManagerImplApi- Parameters:
sess-user- user to get extSources for- Returns:
- list of active user extSources (not older than now - m)
-
getAllBlockedLoginsInNamespaces
Description copied from interface:UsersManagerImplApiReturns all blocked logins in namespaces (if namespace is null, then this login is blocked globally)- Specified by:
getAllBlockedLoginsInNamespacesin interfaceUsersManagerImplApi- Parameters:
sess-- Returns:
- list of all blocked logins in namespaces
-
getAllUserExtSourcesByTypeAndLogin
public List<UserExtSource> getAllUserExtSourcesByTypeAndLogin(PerunSession sess, String extType, String extLogin) Description copied from interface:UsersManagerImplApiGets list of all users external sources by specific type and extLogin.- Specified by:
getAllUserExtSourcesByTypeAndLoginin interfaceUsersManagerImplApi- Parameters:
sess-extType- - type of extSource (ex. 'IDP')extLogin- - extLogin of userExtSource- Returns:
- list of userExtSources with type and login, empty list if no such userExtSource exists
-
getAllowedResources
Description copied from interface:UsersManagerImplApiReturn all resources, where user is allowed by all his members.- Specified by:
getAllowedResourcesin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- All resources where user is allowed
-
getAssignedResources
Description copied from interface:UsersManagerImplApiReturn all resources, where user is assigned through all his members.- Specified by:
getAssignedResourcesin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- All resources where user is assigned
-
getAssignedResources
Description copied from interface:UsersManagerImplApiReturn all resources of specified facility, where user is assigned through all his members.- Specified by:
getAssignedResourcesin interfaceUsersManagerImplApi- Parameters:
sess-facility-user-- Returns:
- All resources where user is assigned
-
getAssignedRichResources
Description copied from interface:UsersManagerImplApiReturn all rich resources, where user is assigned through all his members.- Specified by:
getAssignedRichResourcesin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- All resources where user is assigned
-
getAssociatedResources
Description copied from interface:UsersManagerImplApiReturn all resources of specified facility with which user is associated through all his members. Does not require ACTIVE group-resource assignment.- Specified by:
getAssociatedResourcesin interfaceUsersManagerImplApi- Parameters:
sess-facility-user-- Returns:
- All resources with which user is associated
-
getAssociatedResources
Description copied from interface:UsersManagerImplApiGet all resources with which user can be associated (similar to assigned resources, but does not require ACTIVE group-resource assignment).- Specified by:
getAssociatedResourcesin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- list of resources with which user is associated
-
getBlockedLoginById
public BlockedLogin getBlockedLoginById(PerunSession sess, int id) throws LoginIsNotBlockedException Description copied from interface:UsersManagerImplApiGet blocked login by id- Specified by:
getBlockedLoginByIdin interfaceUsersManagerImplApi- Parameters:
sess- sessionid- id of blocked login- Returns:
- blocked login
- Throws:
LoginIsNotBlockedException- when login is not blocked
-
getBlockedLoginsPage
public Paginated<BlockedLogin> getBlockedLoginsPage(PerunSession sess, BlockedLoginsPageQuery query) Description copied from interface:UsersManagerImplApiGet page of blocked logins.- Specified by:
getBlockedLoginsPagein interfaceUsersManagerImplApi- Parameters:
sess- sessionquery- query with page information- Returns:
- page of requested blocked logins
-
getGroupsWhereUserIsAdmin
Description copied from interface:UsersManagerImplApiReturns list of Groups in Perun, where the User is a direct Administrator or he is a VALID member of any group which is Administrator of some of these Groups.- Specified by:
getGroupsWhereUserIsAdminin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- list of Groups, where user or some of his groups is an Administrator
-
getGroupsWhereUserIsAdmin
Description copied from interface:UsersManagerImplApiReturns list of Groups in selected Vo, where the User is a direct Administrator or he is a VALID member of any group which is Administrator of some of these Groups.- Specified by:
getGroupsWhereUserIsAdminin interfaceUsersManagerImplApi- Parameters:
sess-vo- selected Vo under which we are looking for groupsuser- manager of groups we are looking for- Returns:
- list of Groups, where user or some of his groups (in the Vo) is an Administrator
-
getIdOfBlockedLogin
Description copied from interface:UsersManagerImplApiReturn ID of blocked login- Specified by:
getIdOfBlockedLoginin interfaceUsersManagerImplApi- Parameters:
sess- sessionlogin- loginnamespace- namespace- Returns:
- id of login blocked in specified namespace
-
getPasswordManagerModule
Description copied from interface:UsersManagerImplApiReturn instance of PasswordManagerModule for specified namespace or NULL if class for module is not found. Throws exception if class can't be instantiated.- Specified by:
getPasswordManagerModulein interfaceUsersManagerImplApi- Parameters:
session- Session with authznamespace- Namespace to get PWDMGR module.- Returns:
- Instance of password manager module or NULL if not exists for passed namespace.
-
getPendingPreferredEmailChanges
Description copied from interface:UsersManagerImplApiReturn list of email addresses of user, which are awaiting validation and are inside time window for validation.If there is no preferred email change request pending or requests are outside time window for validation, returns empty list.
- Specified by:
getPendingPreferredEmailChangesin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuser- User to check pending request for- Returns:
- List
user's email addresses pending validation
-
getPreferredEmailChangeRequest
Description copied from interface:UsersManagerImplApiGet new preferred email value from user's original request- Specified by:
getPreferredEmailChangeRequestin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuser- User to get new email address foruuid- UUID of the email change request- Returns:
- String return new preferred email
-
getRelatedUserIdByBlockedLoginInNamespace
public Integer getRelatedUserIdByBlockedLoginInNamespace(PerunSession sess, String login, String namespace) throws LoginIsNotBlockedException Description copied from interface:UsersManagerImplApiGet user id of the user who was related to the given login in the past- Specified by:
getRelatedUserIdByBlockedLoginInNamespacein interfaceUsersManagerImplApi- Parameters:
sess- sessionlogin- blocked loginnamespace- namespace where the login is blocked- Returns:
- user id or null if there is no related user id
- Throws:
LoginIsNotBlockedException
-
getReservedLoginsByApp
Description copied from interface:UsersManagerImplApiGets reserved logins which used in the given application.- Specified by:
getReservedLoginsByAppin interfaceUsersManagerImplApi- Parameters:
sess-appId-- Returns:
- list of logins (Pair: left - namespace, right - login)
-
getReservedLoginsOnlyByGivenApp
Description copied from interface:UsersManagerImplApiGets reserved logins which can be deleted - they are used only in the given application.- Specified by:
getReservedLoginsOnlyByGivenAppin interfaceUsersManagerImplApi- Parameters:
sess-appId-- Returns:
- list of logins (Pair: left - namespace, right - login)
-
getSpecificUsers
Description copied from interface:UsersManagerImplApiReturn all specific Users (only specific users) Return also users who has no owners.- Specified by:
getSpecificUsersin interfaceUsersManagerImplApi- Parameters:
sess-- Returns:
- list of all specific users in perun
-
getSpecificUsersByUser
Description copied from interface:UsersManagerImplApiReturn all specificUsers who are owned by the user and their ownership is not in status disabled- Specified by:
getSpecificUsersByUserin interfaceUsersManagerImplApi- Parameters:
sess-user- the user- Returns:
- list of specificUsers who are owned by the user
-
getSponsors
Description copied from interface:UsersManagerImplApiGets list of user that sponsored a member.- Specified by:
getSponsorsin interfaceUsersManagerImplApi- Parameters:
sess- perun sessionsponsoredMember- member which is sponsored- Returns:
- list of users that sponsored a member.
-
getSponsorsForSponsoredMembersInVo
public Map<Integer,List<Pair<User, getSponsorsForSponsoredMembersInVoSponsorship>>> (PerunSession sess, int voId) Description copied from interface:UsersManagerImplApiRetrieves a map, that maps the ids of the sponsored members in the given VO to a list of their Sponsors with the corresponding Sponsorship objects.- Specified by:
getSponsorsForSponsoredMembersInVoin interfaceUsersManagerImplApi- Parameters:
sess- perun sessionvoId- id of a vo for whose members to retrieve the sponsors- Returns:
- Map of memberIds in the Vo with Lists of Pairs of their Sponsor and Sponsorship objects
-
getUserById
Description copied from interface:UsersManagerImplApiReturns user by its id.- Specified by:
getUserByIdin interfaceUsersManagerImplApi- Parameters:
sess-id-- Returns:
- user
- Throws:
UserNotExistsException
-
getUserByMember
Description copied from interface:UsersManagerImplApiReturns user by VO member.- Specified by:
getUserByMemberin interfaceUsersManagerImplApi- Parameters:
sess-member-- Returns:
- user
-
getUserByUserExtSource
public User getUserByUserExtSource(PerunSession sess, UserExtSource userExtSource) throws UserNotExistsException Description copied from interface:UsersManagerImplApiReturns user by his login in external source.- Specified by:
getUserByUserExtSourcein interfaceUsersManagerImplApi- Parameters:
sess-userExtSource-- Returns:
- user by its userExtSource or throws UserNotExistsException
- Throws:
UserNotExistsException
-
getUserExtSourceByExtLogin
public UserExtSource getUserExtSourceByExtLogin(PerunSession sess, ExtSource source, String extLogin) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerImplApiGets user's external source by the user's external login and external source.- Specified by:
getUserExtSourceByExtLoginin interfaceUsersManagerImplApi- Parameters:
sess-source-extLogin-- Returns:
- user external source object
- Throws:
UserExtSourceNotExistsException
-
getUserExtSourceById
public UserExtSource getUserExtSourceById(PerunSession sess, int id) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerImplApiGet the user ext source by its id.- Specified by:
getUserExtSourceByIdin interfaceUsersManagerImplApi- Parameters:
sess-id-- Returns:
- user external source for the id
- Throws:
UserExtSourceNotExistsException
-
getUserExtSourceByUniqueAttributeValue
public UserExtSource getUserExtSourceByUniqueAttributeValue(PerunSession sess, int attrId, String uniqueValue) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerImplApiReturn userExtSource for specific attribute id and unique value. If not found, throw and exception.It looks for exactly one value of the specific attribute type: - Integer -> exactly match - String -> exactly match - Map -> exactly match of "key=value" - ArrayList -> exactly match of one of the value
- Specified by:
getUserExtSourceByUniqueAttributeValuein interfaceUsersManagerImplApi- Parameters:
sess-attrId- attribute id we are looking foruniqueValue- value used for searching- Returns:
- userExtSource found by attribute id and it's unique value
- Throws:
UserExtSourceNotExistsException- if userExtSource can't be found
-
getUserExtSources
Description copied from interface:UsersManagerImplApiGet List of user ext sources by user- Specified by:
getUserExtSourcesin interfaceUsersManagerImplApi- Parameters:
sess- sessionuser- owner of extSources- Returns:
- List of user's UserExtSources
-
getUserExtSourcesByIds
Description copied from interface:UsersManagerImplApiGets user ext sources by their ids. Silently skips non-existing user ext sources.- Specified by:
getUserExtSourcesByIdsin interfaceUsersManagerImplApi- Parameters:
sess-ids-- Returns:
- List of UserExtSources with specified ids
-
getUsers
Description copied from interface:UsersManagerImplApiReturns all users (included specific users).- Specified by:
getUsersin interfaceUsersManagerImplApi- Parameters:
sess-- Returns:
- list of all users
-
getUsersByAttribute
Description copied from interface:UsersManagerImplApiReturns all users who have set the attribute with the value. Searching only def and opt attributes.- Specified by:
getUsersByAttributein interfaceUsersManagerImplApi- Parameters:
sess-attribute-- Returns:
- list of users
-
getUsersByAttribute
Description copied from interface:UsersManagerImplApiReturns all users who have set the attribute with the value IGNORING CASE in the comparison. Searching only def and opt attributes.- Specified by:
getUsersByAttributein interfaceUsersManagerImplApi- Parameters:
sess-attribute-ignoreCase- TRUE to perform case-insensitive check- Returns:
- list of users
-
getUsersByCoreAttributeValue
public List<User> getUsersByCoreAttributeValue(PerunSession sess, AttributeDefinition attributeDefinition, String attributeValue) Description copied from interface:UsersManagerImplApiReturns all users who have the core attribute with the value. attributeValue is not converted to the attribute type, it is always type of String.- Specified by:
getUsersByCoreAttributeValuein interfaceUsersManagerImplApi- Parameters:
sess-attributeDefinition-attributeValue-- Returns:
- list of users
-
getUsersByAttributeValue
public List<User> getUsersByAttributeValue(PerunSession sess, AttributeDefinition attributeDefinition, String attributeValue) Description copied from interface:UsersManagerImplApiReturns all users who have the attribute with the value. attributeValue is not converted to the attribute type, it is always type of String.- Specified by:
getUsersByAttributeValuein interfaceUsersManagerImplApi- Parameters:
sess-attributeDefinition-attributeValue-- Returns:
- list of users
-
getUsersByExtSourceTypeAndLogin
public List<User> getUsersByExtSourceTypeAndLogin(PerunSession perunSession, String extSourceType, String login) Description copied from interface:UsersManagerImplApiGet all the users who have given type of the ExtSource and login.- Specified by:
getUsersByExtSourceTypeAndLoginin interfaceUsersManagerImplApi- Parameters:
perunSession- perun sessionextSourceType- type of the user extSourcelogin- login of the user- Returns:
- all users with given parameters
-
getUsersByIds
Description copied from interface:UsersManagerImplApiGets users by their ids. Silently skips non-existing users.- Specified by:
getUsersByIdsin interfaceUsersManagerImplApi- Parameters:
sess-usersIds-- Returns:
- List of users with specified ids
-
getUsersBySpecificUser
Description copied from interface:UsersManagerImplApiReturn all users who owns the specificUser and their ownership is not in status disabled- Specified by:
getUsersBySpecificUserin interfaceUsersManagerImplApi- Parameters:
sess-specificUser- the specific User- Returns:
- list of user who owns the specificUser
-
getUnanonymizedUsersBySpecificUser
Description copied from interface:UsersManagerImplApiReturn all users who owns the specificUser and their ownership is not in status disabled and are not anonymized- Specified by:
getUnanonymizedUsersBySpecificUserin interfaceUsersManagerImplApi- Parameters:
sess-specificUser- the specific User- Returns:
- list of user who owns the specificUser
-
getUsersByVo
Description copied from interface:UsersManagerImplApiReturn users which have member in VO.- Specified by:
getUsersByVoin interfaceUsersManagerImplApi- Parameters:
sess-vo-- Returns:
- list of users
-
getUsersCount
Description copied from interface:UsersManagerImplApiGet count of all users.- Specified by:
getUsersCountin interfaceUsersManagerImplApi- Parameters:
sess-- Returns:
- count of all users
-
getUsersPage
Description copied from interface:UsersManagerImplApiGet page of users.- Specified by:
getUsersPagein interfaceUsersManagerImplApi- Parameters:
sess- sessionquery- query with page information- Returns:
- page of requested users
-
getUsersReservedLogins
Description copied from interface:UsersManagerImplApiReturn list of all reserved logins for specific user (pair is namespace and login)- Specified by:
getUsersReservedLoginsin interfaceUsersManagerImplApi- Parameters:
user- for which get reserved logins- Returns:
- list of pairs namespace and login
-
getUsersWithoutVoAssigned
Description copied from interface:UsersManagerImplApiReturns all users who are not member of any VO.- Specified by:
getUsersWithoutVoAssignedin interfaceUsersManagerImplApi- Parameters:
sess-- Returns:
- list of users who are not member of any VO
-
getVosWhereUserIsAdmin
Description copied from interface:UsersManagerImplApiReturns list of VOs, where the user is an Administrator. Including VOs, where the user is a VALID member of authorized group.- Specified by:
getVosWhereUserIsAdminin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- list of VOs, where the user is an Administrator.
-
getVosWhereUserIsMember
Description copied from interface:UsersManagerImplApiReturns list of Vos' ids, where the user is member.- Specified by:
getVosWhereUserIsMemberin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- list of Vos, where the user is member
-
isLoginBlocked
Description copied from interface:UsersManagerImplApiReturn true if login is blocked (globally - for all namespaces per instance OR for some namespace), false if not. Globally banned logins are ALWAYS case-insensitive (ignoreCase value is not taken into account for them).- Specified by:
isLoginBlockedin interfaceUsersManagerImplApi- Parameters:
sess-login- login to checkignoreCase-- Returns:
- true if login is blocked
-
isLoginBlockedForNamespace
public boolean isLoginBlockedForNamespace(PerunSession sess, String login, String namespace, boolean ignoreCase) Description copied from interface:UsersManagerImplApiReturn true if login is blocked for given namespace, false if not When the namespace is null, then the method behaves like isLoginBlockedGlobally(), so it checks if the login is blocked globally. Globally banned logins are ALWAYS case-insensitive.- Specified by:
isLoginBlockedForNamespacein interfaceUsersManagerImplApi- Parameters:
sess-login- login to checknamespace- namespace for loginignoreCase-- Returns:
- true if login is blocked for given namespace (or globally for null namespace)
-
isLoginBlockedGlobally
Description copied from interface:UsersManagerImplApiReturn true if login is blocked globally (for all namespaces per instance - represented by namespace = null), false if not. Globally banned logins are ALWAYS case-insensitive.- Specified by:
isLoginBlockedGloballyin interfaceUsersManagerImplApi- Parameters:
sess-login- login to check- Returns:
- true if login is blocked globally
-
isLoginReserved
public boolean isLoginReserved(PerunSession sess, String namespace, String login, boolean ignoreCase) Description copied from interface:UsersManagerImplApiReturn true if login is already reserved in specified namespace or in any namespace (if namespace is null), false if not.- Specified by:
isLoginReservedin interfaceUsersManagerImplApi- Parameters:
sess-namespace- namespace for login, null for all namespacelogin- login to checkignoreCase- TRUE to perform case-insensitive check- Returns:
- true if login exist, false if not exist
-
isUserAnonymized
Description copied from interface:UsersManagerImplApiChecks whether user has been anonymized or not.- Specified by:
isUserAnonymizedin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- true if user has been anonymized, false otherwise.
-
isUserPerunAdmin
Deprecated.Description copied from interface:UsersManagerImplApiReturns true if the user is PERUNADMIN.- Specified by:
isUserPerunAdminin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- true if the user is PERUNADMIN, false otherwise.
-
loadPasswordResetRequest
public Map<String,Object> loadPasswordResetRequest(PerunSession sess, UUID uuid) throws PasswordResetLinkExpiredException, PasswordResetLinkNotValidException Description copied from interface:UsersManagerImplApiReturns only valid password reset request with specified UUID. Validity is determined by time since request creation and actual usage (only once).If no valid entry is found, exception is thrown. Entry is invalidated once loaded.
- Specified by:
loadPasswordResetRequestin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuuid- UUID of the request to get- Returns:
- Map with 3 keys: - "user_id" = ID of the user who requested this password reset, value is Integer - "namespace" = namespace user wants to reset password, value is String - "mail" = mail used for notification, value is String
- Throws:
PasswordResetLinkExpiredException- when the password reset request expiredPasswordResetLinkNotValidException- when the password reset request was already used or has never existed
-
removeAllAuthorships
Description copied from interface:UsersManagerImplApiRemoves all authorships of user when user is deleted from DB (author records on all his publications).- Specified by:
removeAllAuthorshipsin interfaceUsersManagerImplApi- Parameters:
sess-user-
-
removeAllPasswordResetRequests
Description copied from interface:UsersManagerImplApiRemoves all password reset requests associated with user. This is used when deleting user from Perun.- Specified by:
removeAllPasswordResetRequestsin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuser- User to remove all pwdreset requests
-
removeAllPreferredEmailChangeRequests
Description copied from interface:UsersManagerImplApiRemoves all mail change requests related to user.- Specified by:
removeAllPreferredEmailChangeRequestsin interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionuser- User to remove preferred email change requests for
-
removeAllUserExtSources
Description copied from interface:UsersManagerImplApiRemoves all user's external sources.- Specified by:
removeAllUserExtSourcesin interfaceUsersManagerImplApi- Parameters:
sess-user-
-
removeSpecificUserOwner
public void removeSpecificUserOwner(PerunSession sess, User user, User specificUser) throws SpecificUserOwnerAlreadyRemovedException Description copied from interface:UsersManagerImplApiRemove specificUser owner (the user) Only disable ownership of user and specificUser- Specified by:
removeSpecificUserOwnerin interfaceUsersManagerImplApi- Parameters:
sess-user- the userspecificUser- the specificUser- Throws:
SpecificUserOwnerAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
removeUserExtSource
public void removeUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) throws UserExtSourceAlreadyRemovedException Description copied from interface:UsersManagerImplApiRemoves user's external sources.- Specified by:
removeUserExtSourcein interfaceUsersManagerImplApi- Parameters:
sess-user-userExtSource-- Throws:
UserExtSourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
requestPreferredEmailChange
Description copied from interface:UsersManagerImplApiStore request of change of user's preferred email address. Change in attribute value is not done, until email address is verified by link in email notice. (urn:perun:user:attribute-def:def:preferredEmail)- Specified by:
requestPreferredEmailChangein interfaceUsersManagerImplApi- Parameters:
sess-user-email-- Returns:
- UUID of change request
-
searchForUsers
Description copied from interface:UsersManagerImplApiSimilarity substring search in all users based on fullname, ID and attributes defined in perun.properties- Specified by:
searchForUsersin interfaceUsersManagerImplApi- Parameters:
sess- sessionsearchString- string to search for- Returns:
- list of matched users
-
setSpecificUserType
Description copied from interface:UsersManagerImplApiSet flag for specific user type for the user.- Specified by:
setSpecificUserTypein interfaceUsersManagerImplApi- Parameters:
sess-user- the userspecificUserType- specific type of user- Returns:
-
specificUserOwnershipExists
Description copied from interface:UsersManagerImplApiReturn true if ownership between user and specificUser already exists. Return false if not.- Specified by:
specificUserOwnershipExistsin interfaceUsersManagerImplApi- Parameters:
sess-user-specificUser-- Returns:
- true if ownership exists, false if not
-
unblockLogin
public void unblockLogin(PerunSession sess, String login, String namespace) throws LoginIsNotBlockedException Description copied from interface:UsersManagerImplApiUnblock login for given namespace or unblock login globally (if no namespace is selected)- Specified by:
unblockLoginin interfaceUsersManagerImplApi- Parameters:
sess-login- login to be unblockednamespace- namespace where the login should be unblocked (null means unblock the login globally)- Throws:
LoginIsNotBlockedException
-
unblockLoginsById
Description copied from interface:UsersManagerImplApiUnblock logins by id globally, or in the namespace they were initially blocked.- Specified by:
unblockLoginsByIdin interfaceUsersManagerImplApi- Parameters:
sess- sessionloginIds- list of login ids
-
unblockLoginsForNamespace
Description copied from interface:UsersManagerImplApiUnblock all logins for given namespace- Specified by:
unblockLoginsForNamespacein interfaceUsersManagerImplApi- Parameters:
sess- PerunSessionnamespace- Namespace or null for globally blocked
-
unsetSpecificUserType
Description copied from interface:UsersManagerImplApiUnset flag for specific user type for the user.- Specified by:
unsetSpecificUserTypein interfaceUsersManagerImplApi- Parameters:
sess-user- the userspecificUserType- specific type of user- Returns:
-
updateNameTitles
Description copied from interface:UsersManagerImplApiUpdates titles before/after users name. New titles must be set inside User object. Setting any title to null will remove title from name. Other user's properties are ignored.- Specified by:
updateNameTitlesin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- updated user with new titles before/after name
-
updateUser
Description copied from interface:UsersManagerImplApiUpdates users data in DB.- Specified by:
updateUserin interfaceUsersManagerImplApi- Parameters:
sess-user-- Returns:
- updated user
-
updateUserExtSource
public UserExtSource updateUserExtSource(PerunSession sess, UserExtSource userExtSource) throws UserExtSourceExistsException Description copied from interface:UsersManagerImplApiUpdates user;s userExtSource in DB.- Specified by:
updateUserExtSourcein interfaceUsersManagerImplApi- Parameters:
sess-userExtSource-- Returns:
- updated user
- Throws:
UserExtSourceExistsException- When UES with same login/extSource already exists.
-
updateUserExtSourceLastAccess
Description copied from interface:UsersManagerImplApiUpdates user's userExtSource last access time in DB.- Specified by:
updateUserExtSourceLastAccessin interfaceUsersManagerImplApi- Parameters:
sess-userExtSource-
-
userExists
Description copied from interface:UsersManagerImplApiCheck if user exists in underlaying data source.- Specified by:
userExistsin interfaceUsersManagerImplApi- Parameters:
sess-user- user to check- Returns:
- true if user exists in underlaying data source, false otherwise
-
userExtSourceExists
Description copied from interface:UsersManagerImplApiCheck if userExtSource exists in underlaying data source.- Specified by:
userExtSourceExistsin interfaceUsersManagerImplApi- Parameters:
sess-userExtSource- userExtSource to check- Returns:
- true if userExtSource exists in underlaying data source, false otherwise
-