Class UsersManagerBlImpl
- All Implemented Interfaces:
- UsersManagerBl
- Author:
- Michal Prochazka michalp@ics.muni.cz, Slavek Licehammer glory@ics.muni.cz, Sona Mastrakova
- 
Field SummaryFields inherited from interface cz.metacentrum.perun.core.bl.UsersManagerBlADDITIONAL_IDENTIFIERS_ATTRIBUTE_NAME, ADDITIONAL_IDENTIFIERS_PERUN_ATTRIBUTE_NAME, MULTIVALUE_ATTRIBUTE_SEPARATOR_REGEX, ORIGIN_IDENTITY_PROVIDER_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSpecificUserOwner(PerunSession sess, User user, User specificUser) Add specificUser owner (the user) If not exists, create new ownership.addUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) Adds user's external sources.voidanonymizeUser(PerunSession sess, User user, boolean force) Anonymizes user - according to configuration, each of user's attributes is either anonymized, kept untouched or deleted.voidblockLogins(PerunSession sess, List<String> logins, String namespace, Integer relatedUserId) Block logins for given namespace or block logins globally (if no namespace is selected)voidchangeEmail(PerunSession sess, User user, String newEmail) Change user's email to email from user ext source.voidchangeEmailCustom(PerunSession sess, User user, String newEmail, String url, String lang, String path, String idp) Change user's email to custom email.voidchangeName(PerunSession sess, User user, String newUserName) Change user's name to user's name from user ext source.voidchangeNameCustom(PerunSession sess, User user, String titleBefore, String firstName, String middleName, String lastName, String titleAfter) Change user's name to custom name.voidchangeNonAuthzPassword(PerunSession sess, UUID token, String password, String lang) Changes user password in defined login-namespace based on token of the password reset request.voidchangeOrganization(PerunSession sess, User user, String newOrganizationName) Change organization from which user came to organization from user ext source.voidchangeOrganizationCustom(PerunSession sess, User user, String newOrganizationName) Change organization from which user came to custom organization.voidchangePassword(PerunSession sess, User user, String loginNamespace, String oldPassword, String newPassword, boolean checkOldPassword) Changes user password in defined login-namespace.changePasswordRandom(PerunSession session, User user, String namespace) Generates new random password for given user and returns String representing HTML where is the new password.voidcheckBlockedLogins(PerunSession sess, String namespace, String userLogin, boolean ignoreCase) Check if login is blocked.voidcheckPasswordResetRequestIsValid(PerunSession sess, UUID token) Checks if the password reset request link is valid.voidcheckPasswordStrength(PerunSession sess, String password, String namespace, String login) Check password strength for the given namespace.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) voidcheckUserExtSourceExists(PerunSession sess, UserExtSource userExtSource) voidcheckUserExtSourceExistsById(PerunSession sess, int id) convertRichUsersToRichUsersWithAttributes(PerunSession sess, List<RichUser> richUsers) From List of Rich Users without attribute make list of Rich Users with attributesGet user and convert values of his object attributes: - firstName - lastName - middleName - titleBefore - titleAfter from emptyString (like "") to null.convertUsersToRichUsers(PerunSession sess, List<User> users) From List of Users make list of RichUsers (without attributes)convertUsersToRichUsersWithAttributes(PerunSession sess, List<RichUser> richUsers, List<AttributeDefinition> attrsDef) Convert RichUsers without attribute to RichUsers with specific attributes.convertUsersToRichUsersWithAttributesByNames(PerunSession sess, List<User> users, List<String> attrNames) From List of Users make list of RichUsers (with attributes by names)convertUserToRichUserWithAttributesByNames(PerunSession sess, User user, List<String> attrNames) From User make Rich user (with attributes by names)voidcreateAlternativePassword(PerunSession sess, User user, String description, String loginNamespace, String password) Creates alternative password in external system.createServiceUser(PerunSession sess, Candidate candidate, List<User> owners) From given candidate, creates a service user and assign given owners to him.createUser(PerunSession sess, Candidate candidate) From given candidate, creates a user.createUser(PerunSession sess, User user) Inserts user into DB.voiddeleteAlternativePassword(PerunSession sess, User user, String loginNamespace, String passwordId) Deletes alternative password in external system.voiddeletePassword(PerunSession sess, User user, String loginNamespace) Deletes password in external system for existing user.voiddeletePassword(PerunSession sess, String userLogin, String loginNamespace) Deletes password in external system.voiddeleteReservedLoginsForNamespace(PerunSession sess, String namespace) Deletes all reserved logins in given namespacevoiddeleteReservedLoginsOnlyByGivenApp(PerunSession sess, int appId) Deletes reserved logins which can be deleted - they are used only in the given application.voiddeleteUser(PerunSession sess, User user) Deletes user.voiddeleteUser(PerunSession sess, User user, boolean forceDelete) Deletes user.filterOnlyAllowedAttributes(PerunSession sess, RichUser richUser) For richUser filter all his user attributes and remove all which principal has no access to.filterOnlyAllowedAttributes(PerunSession sess, List<RichUser> richUsers) For list of richUser filter all their user attributes and remove all which principal has no access to.filterOnlyAllowedAttributesForRichUserExtSources(PerunSession sess, List<RichUserExtSource> richUserExtSources) From given list ofRichUserExtSourceremoves the attributes which are not allowed for the current principal.findRichUsers(PerunSession sess, String searchString) Returns list of richusers with attributes who matches the searchString, searching name, id, uuid, email, logins.findRichUsersByExactMatch(PerunSession sess, String searchString) Returns list of richusers with attributes who matches the searchString, searching name, id, uuid, email, logins.findRichUsersWithAttributes(PerunSession sess, String searchString, List<String> attrsName) Returns list of RichUsers with selected attributes who matches the searchString, searching name, id, uuid, email, logins.findRichUsersWithAttributesByExactMatch(PerunSession sess, String searchString, List<String> attrsName) Returns list of RichUsers with selected attributes who matches the searchString, searching name, id, uuid, email, logins.findRichUsersWithoutSpecificVoWithAttributes(PerunSession sess, Vo vo, String searchString, List<String> attrsName) Return list of RichUsers who matches the searchString, searching name, email and logins and are not member in specific VO and contain selected attributes.findUsers(PerunSession sess, String searchString) Returns list of users' who matches the searchString, searching name, id, uuid, email and logins.findUsersByExactMatch(PerunSession sess, String searchString) 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) Finds users with UserExtSource with attribute value that ends with specified string but not with specified exclude strings.generateAccount(PerunSession sess, String loginNamespace, Map<String, String> parameters) Generate user account in a backend system associated with login-namespace in Perun.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, Facility facility, User user) Get all resources from the facility which have the user access on.getAllowedResources(PerunSession sess, User user) Get all resources which have the user access on.getAllRichUsers(PerunSession sess, boolean includedSpecificUsers) Get All richUsers with or without specificUsers.getAllRichUsersWithAttributes(PerunSession sess, boolean includedSpecificUsers) Get All richUsers with or without specificUsers.getAllRichUsersWithAttributes(PerunSession sess, boolean includedSpecificUsers, List<String> attrsName) Get User to RichUser with attributes.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) Get all resources from the facility where the user is assigned.getAssignedResources(PerunSession sess, User user) Get all resources where the user is assigned.getAssignedRichResources(PerunSession sess, User user) Get all rich resources where the user is assigned.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).getBlockedLoginsPage(PerunSession sess, BlockedLoginsPageQuery query) Get page of blocked logins.getGroupsWhereUserIsActive(PerunSession sess, Facility facility, User user) Return all groups where user is active (has VALID status in VO and Group together) for specified user and facilitygetGroupsWhereUserIsActive(PerunSession sess, Resource resource, User user) Return all groups where user is active (has VALID status in VO and Group together) for specified user and resourcegetGroupsWhereUserIsAdmin(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) Returns password manager module for specified login-namespace or falls back on generic password manager module.getPendingPreferredEmailChanges(PerunSession sess, User user) Return list of email addresses of user, which are awaiting validation and are inside time window for validation.Gets the perunBl for this instance.getRelatedUserIdByBlockedLoginInNamespace(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 are 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.getRichUser(PerunSession sess, User user) Get User to RichUser without attributes.getRichUserExtSources(PerunSession sess, User user, List<String> attrsNames) Gets list of all user's external sources with attributes.getRichUsersByIds(PerunSession sess, List<Integer> ids) Returns rich users without attributes by their ids.getRichUsersFromListOfUsers(PerunSession sess, List<User> users) From Users makes RichUsers without attributes.getRichUsersWithAttributesByIds(PerunSession sess, List<Integer> ids) Returns rich users with attributes by their ids.getRichUsersWithAttributesFromListOfUsers(PerunSession sess, List<User> users) From Users makes RichUsers with attributes.Returns all RichUsers with attributes who are not member of any VO.getRichUsersWithoutVoWithAttributes(PerunSession sess, List<String> attrsName) Return list of RichUsers which are not members of any VO and contain selected attributes.getRichUserWithAttributes(PerunSession sess, User user) Get User to RichUser with attributes.getSpecificUsers(PerunSession sess) Return all specific Users (only specific users)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 users that sponsor the 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, their ownership is not in status disabled and are not anonymizedgetUserByExtSourceInformation(PerunSession sess, PerunPrincipal principal) Get user by principal's additional identifiers or extSourceName and extSourceLogin.getUserByExtSourceNameAndExtLogin(PerunSession sess, String extSourceName, String extLogin) Get user by extSourceName and extSourceLogingetUserById(PerunSession sess, int id) Returns user by his/her id.getUserByMember(PerunSession sess, Member member) Returns user by VO member.getUserByUserExtSource(PerunSession sess, UserExtSource userExtSource) Returns user by his login in external source and external source.getUserByUserExtSources(PerunSession sess, List<UserExtSource> userExtSources) Get the user based on one of the userExtSource.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 definition (specified by id) and unique value.getUserExtSourceByUniqueAttributeValue(PerunSession sess, String attrName, String uniqueValue) Return userExtSource for specific attribute definition (specified by id) and unique value.getUserExtSourceFromMultipleIdentifiers(PerunSession sess, PerunPrincipal principal) Iteratively searches through additional identifiers trying to find userExtSource with the same identifier.getUserExtSources(PerunSession sess, User user) Gets list of all user's external sources of the user.getUserExtSourcesByIds(PerunSession sess, List<Integer> ids) Get 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.getUsersByAttribute(PerunSession sess, String attributeName, String attributeValue) Search attributes directly in the DB only if the attr is def or opt and value is type of String, otherwise load all users and search in a loop.getUsersByAttributeValue(PerunSession sess, String attributeName, 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.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) Batch method which returns users by theirs ids.getUsersByPerunBean(PerunSession sess, Facility facility) Returns list of users connected with a facilitygetUsersByPerunBean(PerunSession sess, Group group) Returns list of users connected with a groupgetUsersByPerunBean(PerunSession sess, Host host) Returns list of users connected with a hostgetUsersByPerunBean(PerunSession sess, Member member) Returns list of users connected with a membergetUsersByPerunBean(PerunSession sess, Resource resource) Returns list of users connected with a resourcegetUsersByPerunBean(PerunSession sess, Vo vo) Returns list of users connected with a vogetUsersBySpecificUser(PerunSession sess, User specificUser) Return all users who owns the specificUser and their ownership is not in status disabledintgetUsersCount(PerunSession sess) Get count of all users.Gets the usersManagerImpl for this instance.getUsersPage(PerunSession sess, UsersPageQuery query, List<String> attrNames) Get page of users with the given attributes.getUsersReservedLogins(PerunSession sess, User user) Return list of all reserved logins for specific user (pair is namespace and login)getUsersWithoutSpecificVo(PerunSession sess, Vo vo, String searchString) Return list of users who matches the searchString, searching name, email and logins and are not member in specific VO.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, where the user is a member.booleanisLoginAvailable(PerunSession sess, String loginNamespace, String login) Checks if the login is available in the namespace.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 Globally banned logins are ALWAYS case-insensitive.booleanisUserAnonymized(PerunSession sess, User user) Checks whether user has been anonymized or not.booleanisUserPerunAdmin(PerunSession sess, User user) Deprecated.booleanloginExist(PerunSession sess, User user, String loginNamespace) Checks if login exists in given login-namespace.voidmoveUserExtSource(PerunSession sess, User sourceUser, User targetUser, UserExtSource userExtSource) Take UserExtSource from sourceUser and move it to the targetUser.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 specificUservoidremoveSpecificUserOwner(PerunSession sess, User user, User specificUser, boolean forceDelete) Remove specificUser owner (the user).voidremoveUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) Removes user's external sources.voidrequestPreferredEmailChange(PerunSession sess, String url, User user, String email, String lang, String path, String idp) Request change of user's preferred email address.voidreservePassword(PerunSession sess, User user, String loginNamespace, String password) Reserves the password in external system.voidreservePassword(PerunSession sess, String userLogin, String loginNamespace, String password) Reserves the password in external system.voidreserveRandomPassword(PerunSession sess, User user, String loginNamespace) Reserves random password in external system.searchForUsers(PerunSession sess, String searchString) Similarity substring search in all users based on fullname, ID and attributes defined in perun.properties Places the searchString as line start alwaysvoidsetLogin(PerunSession sess, User user, String loginNamespace, String login) Allow users to manually add login in supported namespace if same login is not reservedvoidsetPerunBl(PerunBl perunBl) setSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType, User owner) Set specific user type for specific user and set ownership of this user for the owner.booleanspecificUserOwnershipExists(PerunSession sess, User user, User specificUser) Return true if ownership of user and specificUser already exists.voidunblockLogins(PerunSession sess, List<String> logins, String namespace) Unblock logins for given namespace or unblock logins 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 namespaceunsetSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType) Remove all ownerships of this specific user and unset this specific user type from this specific 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.booleanuserExtSourceExists(PerunSession sess, UserExtSource userExtSource) voidvalidatePassword(PerunSession sess, User user, String loginNamespace) Validates the password in external system and sets user extSources and extSource related attributes.voidvalidatePassword(PerunSession sess, String userLogin, String loginNamespace) Validates the password in external system and sets user extSources and extSource related attributes.validatePreferredEmailChange(PerunSession sess, User user, UUID token) Validate change of user's preferred email address.voidvalidateSSHKey(PerunSession sess, String sshKey) Validate ssh public key, throws exception if validation fails
- 
Constructor Details- 
UsersManagerBlImplConstructor.- Parameters:
- usersManagerImpl- connection pool
 
 
- 
- 
Method Details- 
addSpecificUserOwnerpublic void addSpecificUserOwner(PerunSession sess, User user, User specificUser) throws RelationExistsException Description copied from interface:UsersManagerBlAdd specificUser owner (the user) If not exists, create new ownership. If exists, only enable ownership for user and specificUser- Specified by:
- addSpecificUserOwnerin interface- UsersManagerBl
- Parameters:
- sess-
- user- the user
- specificUser- the specificUser
- Throws:
- RelationExistsException- If there is such user (the user) who try to add
 
- 
addUserExtSourcepublic UserExtSource addUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) throws UserExtSourceExistsException Description copied from interface:UsersManagerBlAdds user's external sources.- Specified by:
- addUserExtSourcein interface- UsersManagerBl
- Parameters:
- sess-
- user-
- userExtSource-
- Returns:
- user external auth object with newly generated ID
- Throws:
- UserExtSourceExistsException
 
- 
anonymizeUserpublic void anonymizeUser(PerunSession sess, User user, boolean force) throws RelationExistsException, AnonymizationNotSupportedException Description copied from interface:UsersManagerBlAnonymizes user - according to configuration, each of user's attributes is either anonymized, kept untouched or deleted. Also deletes other user's related data, e.g. authorships of users publications, mail change and password reset requests, bans... If force is true then also removes associated members.- Specified by:
- anonymizeUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- force-
- Throws:
- RelationExistsException- if the user has some members assigned
- AnonymizationNotSupportedException- if an attribute should be anonymized but its module doesn't specify the anonymization process or if the anonymization is not supported at this instance
 
- 
blockLoginspublic void blockLogins(PerunSession sess, List<String> logins, String namespace, Integer relatedUserId) throws LoginIsAlreadyBlockedException, LoginExistsException Description copied from interface:UsersManagerBlBlock logins for given namespace or block logins globally (if no namespace is selected)- Specified by:
- blockLoginsin interface- UsersManagerBl
- Parameters:
- sess-
- logins- list of logins to be blocked
- namespace- namespace where the logins should be blocked (null means block the logins globally)
- relatedUserId- id of the user related to the login or null if the relatedUserId should not be stored
- Throws:
- LoginIsAlreadyBlockedException
- LoginExistsException
 
- 
changeNonAuthzPasswordpublic void changeNonAuthzPassword(PerunSession sess, UUID token, String password, String lang) throws LoginNotExistsException, PasswordChangeFailedException, PasswordOperationTimeoutException, PasswordStrengthFailedException, InvalidLoginException, PasswordStrengthException, PasswordResetLinkExpiredException, PasswordResetLinkNotValidException, UserNotExistsException Description copied from interface:UsersManagerBlChanges user password in defined login-namespace based on token of the password reset request.- Specified by:
- changeNonAuthzPasswordin interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- token- token for the password reset request
- password- new password
- lang- Language to get notification in
- Throws:
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordChangeFailedException- When password change failed
- PasswordOperationTimeoutException- When password change timed out
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
- PasswordResetLinkExpiredException- When the password reset request expired
- PasswordResetLinkNotValidException- When the password reset request was already used or has never existed
- UserNotExistsException- When the user who requested the password reset doesn't exist
- PasswordStrengthFailedException
 
- 
changePasswordpublic void changePassword(PerunSession sess, User user, String loginNamespace, String oldPassword, String newPassword, boolean checkOldPassword) throws LoginNotExistsException, PasswordDoesntMatchException, PasswordChangeFailedException, PasswordOperationTimeoutException, PasswordStrengthFailedException, InvalidLoginException, PasswordStrengthException Description copied from interface:UsersManagerBlChanges user password in defined login-namespace. If checkOldPassword is true, then ask authentication system if old password is correct. user must exists.- Specified by:
- changePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- user- user object which is used to get userLogin from the loginNamespace
- loginNamespace-
- oldPassword-
- newPassword-
- checkOldPassword-
- Throws:
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordDoesntMatchException- When old password does not match
- PasswordChangeFailedException
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
- PasswordOperationTimeoutException
- PasswordStrengthFailedException
 
- 
changePasswordRandompublic String changePasswordRandom(PerunSession session, User user, String namespace) throws PasswordOperationTimeoutException, LoginNotExistsException, PasswordChangeFailedException, InvalidLoginException, PasswordStrengthException Description copied from interface:UsersManagerBlGenerates new random password for given user and returns String representing HTML where is the new password.The HTML template is taken from entityless attribute randomPwdResetTemplate and the loginNamespace is used as a key. - Specified by:
- changePasswordRandomin interface- UsersManagerBl
- Parameters:
- session- session
- user- user
- namespace- login namespace
- Returns:
- String representing HTML with data about new generated password
- Throws:
- PasswordOperationTimeoutException- password change timed out
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordChangeFailedException- password change failed
- InvalidLoginException- When When login of user has invalid syntax (is not allowed)
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
 
- 
checkBlockedLoginspublic void checkBlockedLogins(PerunSession sess, String namespace, String userLogin, boolean ignoreCase) throws LoginIsAlreadyBlockedException Description copied from interface:UsersManagerBlCheck if login is blocked. Login can be blocked by default (used by internal components), globally or in namespace.- Specified by:
- checkBlockedLoginsin interface- UsersManagerBl
- Parameters:
- sess- session
- namespace- attribute
- userLogin- login
- ignoreCase- ignore case (work as case-insensitive)
- Throws:
- LoginIsAlreadyBlockedException- when login is blocked
 
- 
checkPasswordResetRequestIsValidpublic void checkPasswordResetRequestIsValid(PerunSession sess, UUID token) throws PasswordResetLinkExpiredException, PasswordResetLinkNotValidException Description copied from interface:UsersManagerBlChecks 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 interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- token- token for the request to check
- Throws:
- PasswordResetLinkExpiredException- when the reset link expired
- PasswordResetLinkNotValidException- when the reset link was already used or has never existed
 
- 
checkPasswordStrengthpublic void checkPasswordStrength(PerunSession sess, String password, String namespace, String login) throws PasswordStrengthException Description copied from interface:UsersManagerBlCheck password strength for the given namespace. If the password is too weak, the PasswordStrengthException is thrown- Specified by:
- checkPasswordStrengthin interface- UsersManagerBl
- Parameters:
- password- password, that will be checked
- namespace- namespace, that will be used to check the strength of the password
- login- login, which may be required for correct password strength check
- Throws:
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
 
- 
checkReservedLoginspublic void checkReservedLogins(PerunSession sess, String namespace, String login, boolean ignoreCase) throws AlreadyReservedLoginException Description copied from interface:UsersManagerBlCheck if login exists in specified namespace or in any namespace (if namespace is null).- Specified by:
- checkReservedLoginsin interface- UsersManagerBl
- Parameters:
- sess-
- namespace- namespace for login, null for all namespace
- login- login to check
- ignoreCase- TRUE to perform case-insensitive check
- Throws:
- AlreadyReservedLoginException- throw this exception if login already exist in table of reserved logins
 
- 
checkUserExists- Specified by:
- checkUserExistsin interface- UsersManagerBl
- Throws:
- UserNotExistsException
 
- 
checkUserExtSourceExistspublic void checkUserExtSourceExists(PerunSession sess, UserExtSource userExtSource) throws UserExtSourceNotExistsException - Specified by:
- checkUserExtSourceExistsin interface- UsersManagerBl
- Throws:
- UserExtSourceNotExistsException
 
- 
checkUserExtSourceExistsByIdpublic void checkUserExtSourceExistsById(PerunSession sess, int id) throws UserExtSourceNotExistsException - Specified by:
- checkUserExtSourceExistsByIdin interface- UsersManagerBl
- Throws:
- UserExtSourceNotExistsException
 
- 
convertRichUsersToRichUsersWithAttributespublic List<RichUser> convertRichUsersToRichUsersWithAttributes(PerunSession sess, List<RichUser> richUsers) throws UserNotExistsException Description copied from interface:UsersManagerBlFrom List of Rich Users without attribute make list of Rich Users with attributes- Specified by:
- convertRichUsersToRichUsersWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- richUsers-
- Returns:
- list of Rich Users with attributes
- Throws:
- UserNotExistsException
 
- 
convertUserEmptyStringsInObjectAttributesIntoNullDescription copied from interface:UsersManagerBlGet user and convert values of his object attributes: - firstName - lastName - middleName - titleBefore - titleAfter from emptyString (like "") to null. If these values are not empty strings, do not change them. If user is null, return null.- Specified by:
- convertUserEmptyStringsInObjectAttributesIntoNullin interface- UsersManagerBl
- Parameters:
- user- user to converting
- Returns:
- converted user
 
- 
convertUserToRichUserWithAttributesByNamespublic RichUser convertUserToRichUserWithAttributesByNames(PerunSession sess, User user, List<String> attrNames) Description copied from interface:UsersManagerBlFrom User make Rich user (with attributes by names)- Specified by:
- convertUserToRichUserWithAttributesByNamesin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user to be converted
- attrNames- list of Strings with attribute names
- Returns:
- RichUser with attributes
 
- 
convertUsersToRichUsersDescription copied from interface:UsersManagerBlFrom List of Users make list of RichUsers (without attributes)- Specified by:
- convertUsersToRichUsersin interface- UsersManagerBl
- Parameters:
- sess-
- users-
- Returns:
- list of RIch Users without attributes
 
- 
convertUsersToRichUsersWithAttributespublic List<RichUser> convertUsersToRichUsersWithAttributes(PerunSession sess, List<RichUser> richUsers, List<AttributeDefinition> attrsDef) Description copied from interface:UsersManagerBlConvert RichUsers without attribute to RichUsers with specific attributes. Specific by list of Attributes. If in list of Attributes is some notUser attribute, it is skipped.- Specified by:
- convertUsersToRichUsersWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- richUsers-
- attrsDef-
- Returns:
- list of RichUsers with specific attributes
 
- 
convertUsersToRichUsersWithAttributesByNamespublic List<RichUser> convertUsersToRichUsersWithAttributesByNames(PerunSession sess, List<User> users, List<String> attrNames) Description copied from interface:UsersManagerBlFrom List of Users make list of RichUsers (with attributes by names)- Specified by:
- convertUsersToRichUsersWithAttributesByNamesin interface- UsersManagerBl
- Parameters:
- sess-
- users-
- Returns:
- list of RIch Users without attributes
 
- 
createAlternativePasswordpublic void createAlternativePassword(PerunSession sess, User user, String description, String loginNamespace, String password) throws PasswordCreationFailedException, LoginNotExistsException, PasswordStrengthException Description copied from interface:UsersManagerBlCreates alternative password in external system.- Specified by:
- createAlternativePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- description- - description of a password (e.g. 'mobile phone', 'tablet', ...)
- loginNamespace-
- password- string representation of password
- Throws:
- PasswordCreationFailedException
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
 
- 
createServiceUserpublic User createServiceUser(PerunSession sess, Candidate candidate, List<User> owners) throws WrongAttributeAssignmentException, UserExtSourceExistsException, WrongReferenceAttributeValueException, WrongAttributeValueException, AttributeNotExistsException Description copied from interface:UsersManagerBlFrom given candidate, creates a service user and assign given owners to him. This method also checks if some of given userExtSources do exist. If so, this method throws a UserExtSourceExistsException. This method can also set only user-def and user-opt attributes for the given candidate.- Specified by:
- createServiceUserin interface- UsersManagerBl
- Parameters:
- sess- session
- candidate- candidate
- owners- owners to be set for the new user
- Returns:
- created service user
- Throws:
- WrongAttributeAssignmentException- if some of the given attributes have unsupported namespace
- UserExtSourceExistsException- if some of the given UES already exist
- WrongReferenceAttributeValueException- if some of the given attribute value cannot be set because of some other attribute constraint
- WrongAttributeValueException- if some of the given attribute value is invalid
- AttributeNotExistsException- if some of the given attributes dont exist
 
- 
createUserDescription copied from interface:UsersManagerBlInserts user into DB.- Specified by:
- createUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
 
- 
createUserpublic User createUser(PerunSession sess, Candidate candidate) throws UserExtSourceExistsException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException, AttributeNotExistsException Description copied from interface:UsersManagerBlFrom given candidate, creates a user. This method also checks if some of given userExtSources do exist. If so, this method throws a UserExtSourceExistsException. This method can also set only user-def and user-opt attributes for the given candidate.- Specified by:
- createUserin interface- UsersManagerBl
- Parameters:
- sess- session
- candidate- candidate
- Returns:
- created user
- Throws:
- UserExtSourceExistsException- if some of the given UES already exist
- WrongAttributeAssignmentException- if some of the given attributes have unsupported namespace
- WrongAttributeValueException- if some of the given attribute value is invalid
- WrongReferenceAttributeValueException- if some of the given attribute value cannot be set because of some other attribute constraint
- AttributeNotExistsException- if some of the given attributes dont exist
 
- 
deleteAlternativePasswordpublic void deleteAlternativePassword(PerunSession sess, User user, String loginNamespace, String passwordId) throws PasswordDeletionFailedException, LoginNotExistsException Description copied from interface:UsersManagerBlDeletes alternative password in external system.- Specified by:
- deleteAlternativePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- loginNamespace-
- passwordId- passwords ID
- Throws:
- PasswordDeletionFailedException
- LoginNotExistsException- When user doesn't have login in specified namespace
 
- 
deletePasswordpublic void deletePassword(PerunSession sess, String userLogin, String loginNamespace) throws LoginNotExistsException, PasswordDeletionFailedException, PasswordOperationTimeoutException, InvalidLoginException Description copied from interface:UsersManagerBlDeletes password in external system. User must not exists.- Specified by:
- deletePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- userLogin- string representation of the userLogin
- loginNamespace-
- Throws:
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordDeletionFailedException
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordOperationTimeoutException
 
- 
deletePasswordpublic void deletePassword(PerunSession sess, User user, String loginNamespace) throws LoginNotExistsException, PasswordDeletionFailedException, PasswordOperationTimeoutException, InvalidLoginException Description copied from interface:UsersManagerBlDeletes password in external system for existing user. User's login for specified namespace must exist in Perun.- Specified by:
- deletePasswordin interface- UsersManagerBl
- Parameters:
- sess- perunSession
- user- for which the password will be deleted
- loginNamespace- from which the password will be deleted
- Throws:
- LoginNotExistsException- When user doesn't have login in specified namespace
- PasswordDeletionFailedException
- PasswordOperationTimeoutException
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
 
- 
deleteReservedLoginsForNamespaceDescription copied from interface:UsersManagerBlDeletes all reserved logins in given namespace- Specified by:
- deleteReservedLoginsForNamespacein interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- namespace- Namespace
 
- 
deleteReservedLoginsOnlyByGivenApppublic void deleteReservedLoginsOnlyByGivenApp(PerunSession sess, int appId) throws PasswordOperationTimeoutException, InvalidLoginException, PasswordDeletionFailedException Description copied from interface:UsersManagerBlDeletes reserved logins which can be deleted - they are used only in the given application. Deletes them from both KDC and DB.- Specified by:
- deleteReservedLoginsOnlyByGivenAppin interface- UsersManagerBl
- Parameters:
- sess-
- appId-
- Throws:
- PasswordOperationTimeoutException
- InvalidLoginException
- PasswordDeletionFailedException
 
- 
deleteUserpublic void deleteUser(PerunSession sess, User user) throws RelationExistsException, MemberAlreadyRemovedException, UserAlreadyRemovedException, SpecificUserAlreadyRemovedException, DeletionNotSupportedException Description copied from interface:UsersManagerBlDeletes user.- Specified by:
- deleteUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Throws:
- RelationExistsException- if user has some members assigned
- MemberAlreadyRemovedException- if there is at least 1 member deleted but not affected by deleting from DB
- UserAlreadyRemovedException- if there are no rows affected by deleting user in DB
- SpecificUserAlreadyRemovedException- if there are no rows affected by deleting specific user in DB
- DeletionNotSupportedException- if the deletion of users is not supported at this instance
 
- 
deleteUserpublic void deleteUser(PerunSession sess, User user, boolean forceDelete) throws RelationExistsException, MemberAlreadyRemovedException, UserAlreadyRemovedException, SpecificUserAlreadyRemovedException, DeletionNotSupportedException Description copied from interface:UsersManagerBlDeletes user. If forceDelete is true, then removes also associated members.- Specified by:
- deleteUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- forceDelete- if true, deletes also all members if they are assigned to the user
- Throws:
- RelationExistsException- if forceDelete is false and the user has some members assigned
- MemberAlreadyRemovedException- if there is at least 1 member deleted but not affected by deleting from DB
- UserAlreadyRemovedException- if there are no rows affected by deleting user in DB
- SpecificUserAlreadyRemovedException- if there are no rows affected by deleting specific user in DBn
- DeletionNotSupportedException- if the deletion of users is not supported at this instance
 
- 
filterOnlyAllowedAttributesDescription copied from interface:UsersManagerBlFor richUser filter all his user attributes and remove all which principal has no access to.- Specified by:
- filterOnlyAllowedAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- richUser-
- Returns:
- richUser with only allowed attributes
 
- 
filterOnlyAllowedAttributesDescription copied from interface:UsersManagerBlFor list of richUser filter all their user attributes and remove all which principal has no access to.- Specified by:
- filterOnlyAllowedAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- richUsers-
- Returns:
- list of RichUsers with only allowed attributes
 
- 
filterOnlyAllowedAttributesForRichUserExtSourcespublic List<RichUserExtSource> filterOnlyAllowedAttributesForRichUserExtSources(PerunSession sess, List<RichUserExtSource> richUserExtSources) Description copied from interface:UsersManagerBlFrom given list ofRichUserExtSourceremoves the attributes which are not allowed for the current principal. The attributes are removed from the given list and the list is also returned.- Specified by:
- filterOnlyAllowedAttributesForRichUserExtSourcesin interface- UsersManagerBl
- Parameters:
- sess- session
- richUserExtSources- richUserExtSources to be filtered
- Returns:
- list of filtered richUserExtSources
 
- 
findRichUserspublic List<RichUser> findRichUsers(PerunSession sess, String searchString) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns list of richusers with attributes who matches the searchString, searching name, id, uuid, email, logins.- Specified by:
- findRichUsersin interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- Returns:
- list of richusers
- Throws:
- UserNotExistsException
 
- 
findRichUsersByExactMatchpublic List<RichUser> findRichUsersByExactMatch(PerunSession sess, String searchString) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns list of richusers with attributes who matches the searchString, searching name, id, uuid, email, logins. Name part is searched for exact match.- Specified by:
- findRichUsersByExactMatchin interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- Returns:
- list of richusers
- Throws:
- UserNotExistsException
 
- 
findRichUsersWithAttributespublic List<RichUser> findRichUsersWithAttributes(PerunSession sess, String searchString, List<String> attrsName) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns list of RichUsers with selected attributes who matches the searchString, searching name, id, uuid, email, logins.- Specified by:
- findRichUsersWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- attrsName-
- Returns:
- list of RichUsers
- Throws:
- UserNotExistsException
 
- 
findRichUsersWithAttributesByExactMatchpublic List<RichUser> findRichUsersWithAttributesByExactMatch(PerunSession sess, String searchString, List<String> attrsName) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns list of RichUsers with selected attributes who matches the searchString, searching name, id, uuid, email, logins. Name part is searched for exact match.- Specified by:
- findRichUsersWithAttributesByExactMatchin interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- attrsName-
- Returns:
- list of RichUsers
- Throws:
- UserNotExistsException
 
- 
findRichUsersWithoutSpecificVoWithAttributespublic List<RichUser> findRichUsersWithoutSpecificVoWithAttributes(PerunSession sess, Vo vo, String searchString, List<String> attrsName) throws UserNotExistsException Description copied from interface:UsersManagerBlReturn list of RichUsers who matches the searchString, searching name, email and logins and are not member in specific VO and contain selected attributes.- Specified by:
- findRichUsersWithoutSpecificVoWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- vo-
- searchString-
- attrsName-
- Returns:
- list of RichUser
- Throws:
- UserNotExistsException
 
- 
findUsersDescription copied from interface:UsersManagerBlReturns list of users' who matches the searchString, searching name, id, uuid, email and logins.- Specified by:
- findUsersin interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- Returns:
- list of users
 
- 
findUsersByExactMatch
- 
findUsersByExactNameDescription copied from interface:UsersManagerBlReturns list of users who exactly matches the searchString- Specified by:
- findUsersByExactNamein interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- Returns:
- list of users
 
- 
findUsersByNameDescription copied from interface:UsersManagerBlReturns list of users who matches the searchString- Specified by:
- findUsersByNamein interface- UsersManagerBl
- Parameters:
- sess-
- searchString-
- Returns:
- list of users
 
- 
findUsersByNamepublic List<User> findUsersByName(PerunSession sess, String titleBefore, String firstName, String middleName, String lastName, String titleAfter) Description copied from interface:UsersManagerBlReturns list of users who matches the fields.- Specified by:
- findUsersByNamein interface- UsersManagerBl
- Parameters:
- sess-
- titleBefore-
- firstName-
- middleName-
- lastName-
- titleAfter-
- Returns:
- list of users
 
- 
findUsersWithExtSourceAttributeValueEndingpublic List<User> findUsersWithExtSourceAttributeValueEnding(PerunSessionImpl sess, String attributeName, String valueEnd, List<String> excludeValueEnds) throws AttributeNotExistsException Description copied from interface:UsersManagerBlFinds users with UserExtSource with attribute value that ends with specified string but not with specified exclude strings. This method is written to find all users with schacHomeOrganization domains ending with valueEnd, but not with exludeValueEnds.- Specified by:
- findUsersWithExtSourceAttributeValueEndingin interface- UsersManagerBl
- Parameters:
- sess- session
- attributeName- UserExtSource attribute name
- valueEnd- required attribute value ending
- excludeValueEnds- exclude these attribute value endings
- Returns:
- list of users
- Throws:
- AttributeNotExistsException
 
- 
generateAccountpublic Map<String,String> generateAccount(PerunSession sess, String loginNamespace, Map<String, String> parameters) throws PasswordStrengthExceptionDescription copied from interface:UsersManagerBlGenerate user account in a backend system associated with login-namespace in Perun.This method consumes optional parameters map. Requirements are implementation-dependant for each login-namespace. Returns map with 1: key=login-namespace attribute urn, value=generated login 2: rest of opt response attributes... - Specified by:
- generateAccountin interface- UsersManagerBl
- Parameters:
- sess-
- loginNamespace- Namespace to generate account in
- parameters- Optional parameters
- Returns:
- Map of data from backed response
- Throws:
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
 
- 
getActiveUserExtSourcesDescription copied from interface:UsersManagerBlGet 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 interface- UsersManagerBl
- Parameters:
- sess-
- user- user to get extSources for
- Returns:
- list of active user extSources (not older than now - m)
 
- 
getAllBlockedLoginsInNamespacesDescription copied from interface:UsersManagerBlReturns all blocked logins in namespaces (if namespace is null, then this login is blocked globally)- Specified by:
- getAllBlockedLoginsInNamespacesin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- list of all blocked logins in namespaces
 
- 
getAllRichUsersDescription copied from interface:UsersManagerBlGet All richUsers with or without specificUsers. If includedSpecificUsers is true, you got all Users included specificUsers If includedSpecificUsers is false, you get all Users without specificUsers- Specified by:
- getAllRichUsersin interface- UsersManagerBl
- Parameters:
- sess-
- includedSpecificUsers- true or false if you want or dont want get specificUsers too
- Returns:
- list of RichUsers
 
- 
getAllRichUsersWithAttributespublic List<RichUser> getAllRichUsersWithAttributes(PerunSession sess, boolean includedSpecificUsers) throws UserNotExistsException Description copied from interface:UsersManagerBlGet All richUsers with or without specificUsers. If includedSpecificUsers is true, you got all Users included specificUsers If includedSpecificUsers is false, you get all Users without specificUsers This method get all RichUsers included Attributes.- Specified by:
- getAllRichUsersWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- includedSpecificUsers- true or false if you want or dont want get specificUsers too
- Returns:
- list of RichUsers
- Throws:
- UserNotExistsException
 
- 
getAllRichUsersWithAttributespublic List<RichUser> getAllRichUsersWithAttributes(PerunSession sess, boolean includedSpecificUsers, List<String> attrsName) throws UserNotExistsException Description copied from interface:UsersManagerBlGet User to RichUser with attributes.- Specified by:
- getAllRichUsersWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- includedSpecificUsers-
- attrsName-
- Returns:
- Throws:
- UserNotExistsException
 
- 
getAllUserExtSourcesByTypeAndLoginpublic List<UserExtSource> getAllUserExtSourcesByTypeAndLogin(PerunSession sess, String extType, String extLogin) Description copied from interface:UsersManagerBlGets list of all users external sources by specific type and extLogin.- Specified by:
- getAllUserExtSourcesByTypeAndLoginin interface- UsersManagerBl
- 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
 
- 
getAllowedResourcesDescription copied from interface:UsersManagerBlGet all resources from the facility which have the user access on.- Specified by:
- getAllowedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- facility-
- user-
- Returns:
- list of resources which have the user access on
 
- 
getAllowedResourcesDescription copied from interface:UsersManagerBlGet all resources which have the user access on.- Specified by:
- getAllowedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of resources which have the user access on
 
- 
getAssignedResourcesDescription copied from interface:UsersManagerBlGet all resources from the facility where the user is assigned.- Specified by:
- getAssignedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- facility-
- user-
- Returns:
- list of resources which have the user access on
 
- 
getAssignedResourcesDescription copied from interface:UsersManagerBlGet all resources where the user is assigned.- Specified by:
- getAssignedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of resources which have the user access on
 
- 
getAssignedRichResourcesDescription copied from interface:UsersManagerBlGet all rich resources where the user is assigned.- Specified by:
- getAssignedRichResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of rich resources which have the user access on
 
- 
getAssociatedResourcesDescription copied from interface:UsersManagerBlReturn all resources of specified facility with which user is associated through all his members. Does not require ACTIVE group-resource assignment.- Specified by:
- getAssociatedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- facility-
- user-
- Returns:
- All resources with which user is associated
 
- 
getAssociatedResourcesDescription copied from interface:UsersManagerBlGet all resources with which user can be associated (similar to assigned resources, but does not require ACTIVE group-resource assignment).- Specified by:
- getAssociatedResourcesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of resources with which the user is associated
 
- 
getBlockedLoginsPagepublic Paginated<BlockedLogin> getBlockedLoginsPage(PerunSession sess, BlockedLoginsPageQuery query) Description copied from interface:UsersManagerBlGet page of blocked logins.- Specified by:
- getBlockedLoginsPagein interface- UsersManagerBl
- Parameters:
- sess- session
- query- query with page information
- Returns:
- page of requested blocked logins
 
- 
getGroupsWhereUserIsActiveDescription copied from interface:UsersManagerBlReturn all groups where user is active (has VALID status in VO and Group together) for specified user and resource- Specified by:
- getGroupsWhereUserIsActivein interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- resource- Only groups assigned to this resource might be returned
- user- Only groups where this user is VALID member might be returned
- Returns:
- List of groups where user is active (is a VALID vo and group member) on specified resource
 
- 
getGroupsWhereUserIsActiveDescription copied from interface:UsersManagerBlReturn all groups where user is active (has VALID status in VO and Group together) for specified user and facility- Specified by:
- getGroupsWhereUserIsActivein interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- facility- Only groups assigned to this facility (all its resources) might be returned
- user- Only groups where this user is VALID member might be returned
- Returns:
- List of groups where user is active (is a VALID vo and group member) on specified facility
 
- 
getGroupsWhereUserIsAdminDescription copied from interface:UsersManagerBlReturns 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 interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of Groups, where user or some of his groups is an Administrator
 
- 
getGroupsWhereUserIsAdminDescription copied from interface:UsersManagerBlReturns 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 interface- UsersManagerBl
- Parameters:
- sess-
- vo- selected Vo under which we are looking for groups
- user- manager of groups we are looking for
- Returns:
- list of Groups, where user or some of his groups (in the Vo) is an Administrator
 
- 
getIdOfBlockedLoginDescription copied from interface:UsersManagerBlReturn ID of blocked login- Specified by:
- getIdOfBlockedLoginin interface- UsersManagerBl
- Parameters:
- sess- session
- login- login
- namespace- namespace
- Returns:
- id of login blocked in specified namespace
 
- 
getPasswordManagerModuleDescription copied from interface:UsersManagerBlReturns password manager module for specified login-namespace or falls back on generic password manager module. Throws exception if no module implementation is found or it can't be instantiated.- Specified by:
- getPasswordManagerModulein interface- UsersManagerBl
- Parameters:
- session- session with authz
- namespace- specific namespace
- Returns:
- Password manager module for namespace or 'generic' module.
 
- 
getPendingPreferredEmailChangespublic List<String> getPendingPreferredEmailChanges(PerunSession sess, User user) throws WrongAttributeAssignmentException, AttributeNotExistsException Description copied from interface:UsersManagerBlReturn 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 interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- user- User to check pending request for
- Returns:
- Listuser's email addresses pending validation 
- Throws:
- WrongAttributeAssignmentException
- AttributeNotExistsException
 
- 
getPerunBlGets the perunBl for this instance.- Returns:
- The perunBl.
 
- 
getRelatedUserIdByBlockedLoginInNamespacepublic Integer getRelatedUserIdByBlockedLoginInNamespace(PerunSession sess, String login, String namespace) throws LoginIsNotBlockedException Description copied from interface:UsersManagerBlGet user id of the user who was related to the given login in the past- Specified by:
- getRelatedUserIdByBlockedLoginInNamespacein interface- UsersManagerBl
- Parameters:
- sess- session
- login- blocked login
- namespace- namespace where the login is blocked
- Returns:
- user id or null if there is no related user id
- Throws:
- LoginIsNotBlockedException
 
- 
getReservedLoginsByAppDescription copied from interface:UsersManagerBlGets reserved logins which are used in the given application.- Specified by:
- getReservedLoginsByAppin interface- UsersManagerBl
- Parameters:
- sess-
- appId-
- Returns:
- list of logins (Pair: left - namespace, right - login)
 
- 
getReservedLoginsOnlyByGivenAppDescription copied from interface:UsersManagerBlGets reserved logins which can be deleted - they are used only in the given application.- Specified by:
- getReservedLoginsOnlyByGivenAppin interface- UsersManagerBl
- Parameters:
- sess-
- appId-
- Returns:
- list of logins (Pair: left - namespace, right - login)
 
- 
getRichUserDescription copied from interface:UsersManagerBlGet User to RichUser without attributes.- Specified by:
- getRichUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
 
- 
getRichUserExtSourcespublic List<RichUserExtSource> getRichUserExtSources(PerunSession sess, User user, List<String> attrsNames) Description copied from interface:UsersManagerBlGets list of all user's external sources with attributes. If any of the attribute names is incorrect then the value is silently skipped. If the attrsNames is null, then this method returns all ues attributes.- Specified by:
- getRichUserExtSourcesin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user for who should be the data returned
- attrsNames- list of attribute names that should be found, if null or empty return all
- Returns:
- list of user's external sources with attributes
 
- 
getRichUserWithAttributespublic RichUser getRichUserWithAttributes(PerunSession sess, User user) throws UserNotExistsException Description copied from interface:UsersManagerBlGet User to RichUser with attributes.- Specified by:
- getRichUserWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- Throws:
- UserNotExistsException
 
- 
getRichUsersByIdsDescription copied from interface:UsersManagerBlReturns rich users without attributes by their ids.- Specified by:
- getRichUsersByIdsin interface- UsersManagerBl
- Parameters:
- sess-
- ids-
- Returns:
- list of rich users with specified ids
 
- 
getRichUsersFromListOfUsersDescription copied from interface:UsersManagerBlFrom Users makes RichUsers without attributes.- Specified by:
- getRichUsersFromListOfUsersin interface- UsersManagerBl
- Parameters:
- sess-
- users- users to convert
- Returns:
- list of richUsers
 
- 
getRichUsersWithAttributesByIdspublic List<RichUser> getRichUsersWithAttributesByIds(PerunSession sess, List<Integer> ids) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns rich users with attributes by their ids.- Specified by:
- getRichUsersWithAttributesByIdsin interface- UsersManagerBl
- Parameters:
- sess-
- ids-
- Returns:
- list of rich users with specified ids
- Throws:
- UserNotExistsException
 
- 
getRichUsersWithAttributesFromListOfUserspublic List<RichUser> getRichUsersWithAttributesFromListOfUsers(PerunSession sess, List<User> users) throws UserNotExistsException Description copied from interface:UsersManagerBlFrom Users makes RichUsers with attributes.- Specified by:
- getRichUsersWithAttributesFromListOfUsersin interface- UsersManagerBl
- Parameters:
- sess-
- users- users to convert
- Returns:
- list of richUsers
- Throws:
- UserNotExistsException
 
- 
getRichUsersWithoutVoAssignedpublic List<RichUser> getRichUsersWithoutVoAssigned(PerunSession sess) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns all RichUsers with attributes who are not member of any VO.- Specified by:
- getRichUsersWithoutVoAssignedin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- list of richUsers who are not member of any VO
- Throws:
- UserNotExistsException
 
- 
getRichUsersWithoutVoWithAttributespublic List<RichUser> getRichUsersWithoutVoWithAttributes(PerunSession sess, List<String> attrsName) throws UserNotExistsException Description copied from interface:UsersManagerBlReturn list of RichUsers which are not members of any VO and contain selected attributes.- Specified by:
- getRichUsersWithoutVoWithAttributesin interface- UsersManagerBl
- Parameters:
- sess-
- attrsName-
- Returns:
- list of RichUsers
- Throws:
- UserNotExistsException
 
- 
getSpecificUsersDescription copied from interface:UsersManagerBlReturn all specific Users (only specific users)- Specified by:
- getSpecificUsersin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- list of all specific users in perun
 
- 
getSpecificUsersByUserDescription copied from interface:UsersManagerBlReturn all specificUsers who are owned by the user and their ownership is not in status disabled- Specified by:
- getSpecificUsersByUserin interface- UsersManagerBl
- Parameters:
- sess-
- user- the user
- Returns:
- list of specific users who are owned by the user
 
- 
getSponsorsDescription copied from interface:UsersManagerBlGets list of users that sponsor the member.- Specified by:
- getSponsorsin interface- UsersManagerBl
- Parameters:
- sess- perun session
- sponsoredMember- member which is sponsored
- Returns:
- list of users that sponsor the member.
 
- 
getSponsorsForSponsoredMembersInVopublic Map<Integer,List<Pair<User, getSponsorsForSponsoredMembersInVoSponsorship>>> (PerunSession sess, int voId) Description copied from interface:UsersManagerBlRetrieves 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 interface- UsersManagerBl
- Parameters:
- sess- perun session
- voId- 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
 
- 
getUserByExtSourceInformationpublic User getUserByExtSourceInformation(PerunSession sess, PerunPrincipal principal) throws UserExtSourceNotExistsException, UserNotExistsException, ExtSourceNotExistsException Description copied from interface:UsersManagerBlGet user by principal's additional identifiers or extSourceName and extSourceLogin. Additional identifiers are used in case principal's extSource was send through proxy which has enabled multiple identifiers. extSourceName and extSourceLogin are used otherwise.- Specified by:
- getUserByExtSourceInformationin interface- UsersManagerBl
- Parameters:
- sess-
- principal-
- Returns:
- Throws:
- UserExtSourceNotExistsException
- UserNotExistsException
- ExtSourceNotExistsException
 
- 
getUserByExtSourceNameAndExtLoginpublic User getUserByExtSourceNameAndExtLogin(PerunSession sess, String extSourceName, String extLogin) throws ExtSourceNotExistsException, UserExtSourceNotExistsException, UserNotExistsException Description copied from interface:UsersManagerBlGet user by extSourceName and extSourceLogin- Specified by:
- getUserByExtSourceNameAndExtLoginin interface- UsersManagerBl
- Parameters:
- sess-
- extSourceName-
- extLogin-
- Returns:
- user
- Throws:
- ExtSourceNotExistsException
- UserExtSourceNotExistsException
- UserNotExistsException
 
- 
getUserByIdDescription copied from interface:UsersManagerBlReturns user by his/her id.- Specified by:
- getUserByIdin interface- UsersManagerBl
- Parameters:
- sess-
- id-
- Returns:
- user
- Throws:
- UserNotExistsException
 
- 
getUserByMemberDescription copied from interface:UsersManagerBlReturns user by VO member.- Specified by:
- getUserByMemberin interface- UsersManagerBl
- Parameters:
- sess-
- member-
- Returns:
- user
 
- 
getUserByUserExtSourcepublic User getUserByUserExtSource(PerunSession sess, UserExtSource userExtSource) throws UserNotExistsException Description copied from interface:UsersManagerBlReturns user by his login in external source and external source.- Specified by:
- getUserByUserExtSourcein interface- UsersManagerBl
- Parameters:
- sess-
- userExtSource-
- Returns:
- selected user or throws UserNotExistsException in case the user doesn't exists
- Throws:
- UserNotExistsException
 
- 
getUserByUserExtSourcespublic User getUserByUserExtSources(PerunSession sess, List<UserExtSource> userExtSources) throws UserNotExistsException Description copied from interface:UsersManagerBlGet the user based on one of the userExtSource.- Specified by:
- getUserByUserExtSourcesin interface- UsersManagerBl
- Parameters:
- sess-
- userExtSources-
- Returns:
- user
- Throws:
- UserNotExistsException
 
- 
getUserExtSourceByExtLoginpublic UserExtSource getUserExtSourceByExtLogin(PerunSession sess, ExtSource source, String extLogin) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerBlGets user's external source by the user's external login and external source.- Specified by:
- getUserExtSourceByExtLoginin interface- UsersManagerBl
- Parameters:
- sess-
- source-
- extLogin-
- Returns:
- user external source object
- Throws:
- UserExtSourceNotExistsException
 
- 
getUserExtSourceByIdpublic UserExtSource getUserExtSourceById(PerunSession sess, int id) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerBlGet the user ext source by its id.- Specified by:
- getUserExtSourceByIdin interface- UsersManagerBl
- Parameters:
- sess-
- id-
- Returns:
- user external source for the id
- Throws:
- UserExtSourceNotExistsException
 
- 
getUserExtSourceByUniqueAttributeValuepublic UserExtSource getUserExtSourceByUniqueAttributeValue(PerunSession sess, int attrId, String uniqueValue) throws AttributeNotExistsException, UserExtSourceNotExistsException Description copied from interface:UsersManagerBlReturn userExtSource for specific attribute definition (specified by 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 interface- UsersManagerBl
- Parameters:
- sess-
- attrId- attribute id used for founding attribute definition which has to exists, be unique and in userExtSource namespace
- uniqueValue- value used for searching
- Returns:
- userExtSource found by attribute id and it's unique value
- Throws:
- AttributeNotExistsException- if attribute can't be found by it's id
- UserExtSourceNotExistsException- if userExtSource can't be found
 
- 
getUserExtSourceByUniqueAttributeValuepublic UserExtSource getUserExtSourceByUniqueAttributeValue(PerunSession sess, String attrName, String uniqueValue) throws AttributeNotExistsException, UserExtSourceNotExistsException Description copied from interface:UsersManagerBlReturn userExtSource for specific attribute definition (specified by 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 interface- UsersManagerBl
- Parameters:
- sess-
- attrName- attribute name used for founding attribute definition which has to exists, be unique and in userExtSource namespace
- uniqueValue- value used for searching
- Returns:
- userExtSource found by attribute name and it's unique value
- Throws:
- AttributeNotExistsException- if attribute can't be found by it's name
- UserExtSourceNotExistsException- if userExtSource can't be found
 
- 
getUserExtSourceFromMultipleIdentifierspublic UserExtSource getUserExtSourceFromMultipleIdentifiers(PerunSession sess, PerunPrincipal principal) throws UserExtSourceNotExistsException Description copied from interface:UsersManagerBlIteratively searches through additional identifiers trying to find userExtSource with the same identifier. Returns first found userExtSource or throw an exception when no matching userExtSource is found.- Specified by:
- getUserExtSourceFromMultipleIdentifiersin interface- UsersManagerBl
- Parameters:
- sess- PerunSession to retrieve UserExtSource
- principal- PerunPrincipal which contains additionalIdentifiers
- Returns:
- UserExtSource found using additionalIdentifiers
- Throws:
- UserExtSourceNotExistsException- When no matching userExtSource is found
 
- 
getUserExtSourcesDescription copied from interface:UsersManagerBlGets list of all user's external sources of the user.- Specified by:
- getUserExtSourcesin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of user's external sources
 
- 
getUserExtSourcesByIdsDescription copied from interface:UsersManagerBlGet user ext sources by their ids.- Specified by:
- getUserExtSourcesByIdsin interface- UsersManagerBl
- Parameters:
- sess-
- ids-
- Returns:
- list of user external sources with specified ids
 
- 
getUsersDescription copied from interface:UsersManagerBlReturns all users (included specific users)- Specified by:
- getUsersin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- list of all users
 
- 
getUsersByAttributeDescription copied from interface:UsersManagerBlReturns all users who have set the attribute with the value. Searching only def and opt attributes.- Specified by:
- getUsersByAttributein interface- UsersManagerBl
- Parameters:
- sess-
- attribute-
- Returns:
- list of users
 
- 
getUsersByAttributepublic List<User> getUsersByAttribute(PerunSession sess, String attributeName, String attributeValue) Search attributes directly in the DB only if the attr is def or opt and value is type of String, otherwise load all users and search in a loop.- Specified by:
- getUsersByAttributein interface- UsersManagerBl
- Parameters:
- sess-
- attributeName-
- attributeValue-
- Returns:
- list of users
 
- 
getUsersByAttributeDescription copied from interface:UsersManagerBlReturns all users who have set the attribute with the value IGNORING CASE in the comparison. Searching only def and opt attributes.- Specified by:
- getUsersByAttributein interface- UsersManagerBl
- Parameters:
- sess-
- attribute-
- ignoreCase- TRUE to perform case-insensitive check
- Returns:
- list of users
 
- 
getUsersByAttributeValuepublic List<User> getUsersByAttributeValue(PerunSession sess, String attributeName, String attributeValue) Description copied from interface:UsersManagerBlReturns 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 interface- UsersManagerBl
- Parameters:
- sess-
- attributeName-
- attributeValue-
- Returns:
- list of users
 
- 
getUsersByExtSourceTypeAndLoginpublic List<User> getUsersByExtSourceTypeAndLogin(PerunSession perunSession, String extSourceType, String login) Description copied from interface:UsersManagerBlGet all the users who have given type of the ExtSource and login.- Specified by:
- getUsersByExtSourceTypeAndLoginin interface- UsersManagerBl
- Parameters:
- perunSession- perun session
- extSourceType- type of the user extSource
- login- login of the user
- Returns:
- all users with given parameters
 
- 
getUsersByIdsDescription copied from interface:UsersManagerBlBatch method which returns users by theirs ids.- Specified by:
- getUsersByIdsin interface- UsersManagerBl
- Parameters:
- sess-
- usersIds-
- Returns:
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a group- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- group-
- Returns:
- list of users connected with group
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a member- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- member-
- Returns:
- list of users connected with member
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a resource- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of users connected with resource
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a host- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- host-
- Returns:
- list of users connected with host
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a facility- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- facility-
- Returns:
- list of users connected with facility
 
- 
getUsersByPerunBeanDescription copied from interface:UsersManagerBlReturns list of users connected with a vo- Specified by:
- getUsersByPerunBeanin interface- UsersManagerBl
- Parameters:
- sess-
- vo-
- Returns:
- list of users connected with vo
 
- 
getUsersBySpecificUserDescription copied from interface:UsersManagerBlReturn all users who owns the specificUser and their ownership is not in status disabled- Specified by:
- getUsersBySpecificUserin interface- UsersManagerBl
- Parameters:
- sess-
- specificUser- the specific User
- Returns:
- list of user who owns the specificUser
 
- 
getUnanonymizedUsersBySpecificUserDescription copied from interface:UsersManagerBlReturn all users who owns the specificUser, their ownership is not in status disabled and are not anonymized- Specified by:
- getUnanonymizedUsersBySpecificUserin interface- UsersManagerBl
- Parameters:
- sess-
- specificUser- the specific User
- Returns:
- list of user who owns the specificUser
 
- 
getUsersCountDescription copied from interface:UsersManagerBlGet count of all users.- Specified by:
- getUsersCountin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- count of all users
 
- 
getUsersManagerImplGets the usersManagerImpl for this instance.- Returns:
- The usersManagerImpl.
 
- 
getUsersPagepublic Paginated<RichUser> getUsersPage(PerunSession sess, UsersPageQuery query, List<String> attrNames) Description copied from interface:UsersManagerBlGet page of users with the given attributes.- Specified by:
- getUsersPagein interface- UsersManagerBl
- Parameters:
- sess- session
- query- query with page information
- attrNames- list of attribute names
- Returns:
- page of requested rich users
 
- 
getUsersReservedLoginsDescription copied from interface:UsersManagerBlReturn list of all reserved logins for specific user (pair is namespace and login)- Specified by:
- getUsersReservedLoginsin interface- UsersManagerBl
- Parameters:
- user- for which get reserved logins
- Returns:
- list of pairs namespace and login
 
- 
getUsersWithoutSpecificVoDescription copied from interface:UsersManagerBlReturn list of users who matches the searchString, searching name, email and logins and are not member in specific VO.- Specified by:
- getUsersWithoutSpecificVoin interface- UsersManagerBl
- Parameters:
- sess-
- vo-
- searchString-
- Returns:
- list of users
 
- 
getUsersWithoutVoAssignedDescription copied from interface:UsersManagerBlReturns all users who are not member of any VO.- Specified by:
- getUsersWithoutVoAssignedin interface- UsersManagerBl
- Parameters:
- sess-
- Returns:
- list of users who are not member of any VO
 
- 
getVosWhereUserIsAdminDescription copied from interface:UsersManagerBlReturns list of VOs, where the user is an Administrator. Including VOs, where the user is a VALID member of authorized group.- Specified by:
- getVosWhereUserIsAdminin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of VOs, where the user is an Administrator.
 
- 
getVosWhereUserIsMemberDescription copied from interface:UsersManagerBlReturns list of VOs, where the user is a member.- Specified by:
- getVosWhereUserIsMemberin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- list of VOs, where the user is a member.
 
- 
isLoginAvailablepublic boolean isLoginAvailable(PerunSession sess, String loginNamespace, String login) throws InvalidLoginException Description copied from interface:UsersManagerBlChecks if the login is available in the namespace. Returns FALSE is is already occupied, throws exception if value is not allowed.- Specified by:
- isLoginAvailablein interface- UsersManagerBl
- Parameters:
- sess-
- loginNamespace- in which the login will be checked (provide only the name of the namespace, not the whole attribute name)
- login- to be checked
- Returns:
- true if login is available, false otherwise
- Throws:
- InvalidLoginException- When login to check has invalid syntax or is not allowed.
 
- 
isLoginBlockedDescription copied from interface:UsersManagerBlReturn 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 interface- UsersManagerBl
- Parameters:
- sess-
- login- login to check
- ignoreCase-
- Returns:
- true if login is blocked
 
- 
isLoginBlockedForNamespacepublic boolean isLoginBlockedForNamespace(PerunSession sess, String login, String namespace, boolean ignoreCase) Description copied from interface:UsersManagerBlReturn 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 interface- UsersManagerBl
- Parameters:
- sess-
- login- login to check
- namespace- namespace for login
- ignoreCase-
- Returns:
- true if login is blocked for given namespace (or globally for null namespace)
 
- 
isLoginBlockedGloballyDescription copied from interface:UsersManagerBlReturn 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 interface- UsersManagerBl
- Parameters:
- sess-
- login- login to check
- Returns:
- true if login is blocked globally
 
- 
isUserAnonymizedDescription copied from interface:UsersManagerBlChecks whether user has been anonymized or not.- Specified by:
- isUserAnonymizedin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- true if user has been anonymized, false otherwise.
 
- 
isUserPerunAdminDeprecated.Description copied from interface:UsersManagerBlReturns true if the user is PERUNADMIN.- Specified by:
- isUserPerunAdminin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- true if the user is PERUNADMIN, false otherwise.
 
- 
loginExistDescription copied from interface:UsersManagerBlChecks if login exists in given login-namespace.- Specified by:
- loginExistin interface- UsersManagerBl
- Parameters:
- sess- perunSession
- user-
- loginNamespace-
- Returns:
- True if login for user exists in given namespace, false otherwise
 
- 
moveUserExtSourcepublic void moveUserExtSource(PerunSession sess, User sourceUser, User targetUser, UserExtSource userExtSource) Description copied from interface:UsersManagerBlTake UserExtSource from sourceUser and move it to the targetUser.It removes old UserExtSource with all it's attributes from sourceUser and creates and assigns the new one with the same settings to target user. - Specified by:
- moveUserExtSourcein interface- UsersManagerBl
- Parameters:
- sess-
- sourceUser- user with UserExtSource to move
- targetUser- user for who will be UserExtSource moved
- userExtSource- the UserExtSource which will be moved from sourceUser to targetUser
 
- 
removeAllUserExtSourcesDescription copied from interface:UsersManagerBlRemoves all user's external sources. It also means removing all it's attributes.- Specified by:
- removeAllUserExtSourcesin interface- UsersManagerBl
- Parameters:
- sess- session
- user- owner of external sources
 
- 
removeSpecificUserOwnerpublic void removeSpecificUserOwner(PerunSession sess, User user, User specificUser) throws RelationNotExistsException, SpecificUserOwnerAlreadyRemovedException Description copied from interface:UsersManagerBlRemove specificUser owner (the user) Only disable ownership of user and specificUser- Specified by:
- removeSpecificUserOwnerin interface- UsersManagerBl
- Parameters:
- sess-
- user- the user
- specificUser- the specificUser
- Throws:
- RelationNotExistsException- if there is no such user (the user) to remove
- SpecificUserOwnerAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
removeSpecificUserOwnerpublic void removeSpecificUserOwner(PerunSession sess, User user, User specificUser, boolean forceDelete) throws RelationNotExistsException, SpecificUserOwnerAlreadyRemovedException Description copied from interface:UsersManagerBlRemove specificUser owner (the user). If forceDelete false, only disable ownership of user and specificUser. If forceDelete true, delete this ownership from DB.- Specified by:
- removeSpecificUserOwnerin interface- UsersManagerBl
- Parameters:
- sess-
- user- the user
- specificUser- the specificUser
- forceDelete- if true, remove from database, if false, only disable this ownership
- Throws:
- RelationNotExistsException- if there is no such user (the user) to remove
- SpecificUserOwnerAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
removeUserExtSourcepublic void removeUserExtSource(PerunSession sess, User user, UserExtSource userExtSource) throws UserExtSourceAlreadyRemovedException Description copied from interface:UsersManagerBlRemoves user's external sources. It also means removing all it's attributes.- Specified by:
- removeUserExtSourcein interface- UsersManagerBl
- Parameters:
- sess-
- user-
- userExtSource-
- Throws:
- UserExtSourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
requestPreferredEmailChangepublic void requestPreferredEmailChange(PerunSession sess, String url, User user, String email, String lang, String path, String idp) Description copied from interface:UsersManagerBlRequest 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 interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- url- base URL of running perun instance passed from RPC.
- user- User to request preferred email change for
- email- new email address
- lang- language to get confirmation mail in (optional)
- path- path that is appended to the url of the verification link (optional)
- idp- authentication method appended to query parameters of verification link (optional)
 
- 
reservePasswordpublic void reservePassword(PerunSession sess, String userLogin, String loginNamespace, String password) throws PasswordCreationFailedException, PasswordOperationTimeoutException, PasswordStrengthFailedException, InvalidLoginException, PasswordStrengthException Description copied from interface:UsersManagerBlReserves the password in external system. User must not exists.- Specified by:
- reservePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- userLogin- string representation of the userLogin
- loginNamespace-
- password-
- Throws:
- PasswordCreationFailedException
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
- PasswordOperationTimeoutException
- PasswordStrengthFailedException
 
- 
reservePasswordpublic void reservePassword(PerunSession sess, User user, String loginNamespace, String password) throws PasswordCreationFailedException, LoginNotExistsException, PasswordOperationTimeoutException, PasswordStrengthFailedException, InvalidLoginException, PasswordStrengthException Description copied from interface:UsersManagerBlReserves the password in external system. User must exists. User's login for specified namespace must exist in Perun.- Specified by:
- reservePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- loginNamespace-
- password-
- Throws:
- PasswordCreationFailedException
- LoginNotExistsException- When user doesn't have login in specified namespace
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordStrengthException- When password doesn't match expected strength by namespace configuration
- PasswordOperationTimeoutException
- PasswordStrengthFailedException
 
- 
reserveRandomPasswordpublic void reserveRandomPassword(PerunSession sess, User user, String loginNamespace) throws PasswordCreationFailedException, LoginNotExistsException, PasswordOperationTimeoutException, PasswordStrengthFailedException, InvalidLoginException Description copied from interface:UsersManagerBlReserves random password in external system. User must exists. User's login for specified namespace must exist in Perun.- Specified by:
- reserveRandomPasswordin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- loginNamespace-
- Throws:
- PasswordCreationFailedException
- LoginNotExistsException- When user doesn't have login in specified namespace
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
- PasswordOperationTimeoutException
- PasswordStrengthFailedException
 
- 
setLoginDescription copied from interface:UsersManagerBlAllow users to manually add login in supported namespace if same login is not reserved- Specified by:
- setLoginin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- loginNamespace-
- login-
 
- 
setPerunBl
- 
searchForUsersDescription copied from interface:UsersManagerBlSimilarity substring search in all users based on fullname, ID and attributes defined in perun.properties Places the searchString as line start always- Specified by:
- searchForUsersin interface- UsersManagerBl
- Parameters:
- sess- session
- searchString- string to search for
- Returns:
- list of matched users
 
- 
setSpecificUserpublic User setSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType, User owner) throws RelationExistsException Description copied from interface:UsersManagerBlSet specific user type for specific user and set ownership of this user for the owner.- Specified by:
- setSpecificUserin interface- UsersManagerBl
- Parameters:
- sess- perun session
- specificUser- specific user
- specificUserType- specific type of user
- owner- user, who will be owner of the specific user
- Returns:
- specific user with specific user type set
- Throws:
- RelationExistsException
 
- 
specificUserOwnershipExistsDescription copied from interface:UsersManagerBlReturn true if ownership of user and specificUser already exists. Return false if not. Looking for enabled and also for disabled ownership.- Specified by:
- specificUserOwnershipExistsin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- specificUser-
- Returns:
 
- 
unblockLoginspublic void unblockLogins(PerunSession sess, List<String> logins, String namespace) throws LoginIsNotBlockedException Description copied from interface:UsersManagerBlUnblock logins for given namespace or unblock logins globally (if no namespace is selected)- Specified by:
- unblockLoginsin interface- UsersManagerBl
- Parameters:
- sess-
- logins- logins list of logins to be unblocked
- namespace- namespace where the logins should be unblocked (null means unblock the logins globally)
- Throws:
- LoginIsNotBlockedException
 
- 
unblockLoginsByIdpublic void unblockLoginsById(PerunSession sess, List<Integer> loginIds) throws LoginIsNotBlockedException Description copied from interface:UsersManagerBlUnblock logins by id globally, or in the namespace they were initially blocked.- Specified by:
- unblockLoginsByIdin interface- UsersManagerBl
- Parameters:
- sess- session
- loginIds- list of login ids
- Throws:
- LoginIsNotBlockedException- when login is not blocked
 
- 
unblockLoginsForNamespaceDescription copied from interface:UsersManagerBlUnblock all logins for given namespace- Specified by:
- unblockLoginsForNamespacein interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- namespace- Namespace or null for globally blocked
 
- 
unsetSpecificUserpublic User unsetSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType) throws ServiceOnlyRoleAssignedException Description copied from interface:UsersManagerBlRemove all ownerships of this specific user and unset this specific user type from this specific user.- Specified by:
- unsetSpecificUserin interface- UsersManagerBl
- Parameters:
- sess- perun session
- specificUser- specific user
- specificUserType- specific type of user
- Returns:
- user who is no more specific
- Throws:
- ServiceOnlyRoleAssignedException- when trying to unset service flag from a user with service only role
 
- 
updateNameTitlesDescription copied from interface:UsersManagerBlUpdates 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 interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- updated user with new titles before/after name
- Throws:
- UserNotExistsException- if user not exists when method trying to update him
 
- 
updateUserDescription copied from interface:UsersManagerBlUpdates users data in DB.- Specified by:
- updateUserin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- Returns:
- updated user
- Throws:
- UserNotExistsException- if user not exists when method trying to update him
 
- 
updateUserExtSourcepublic UserExtSource updateUserExtSource(PerunSession sess, UserExtSource userExtSource) throws UserExtSourceExistsException Description copied from interface:UsersManagerBlUpdates user's userExtSource in DB.- Specified by:
- updateUserExtSourcein interface- UsersManagerBl
- Parameters:
- sess-
- userExtSource-
- Returns:
- updated userExtSource
- Throws:
- UserExtSourceExistsException- When UES with same login/extSource already exists.
 
- 
updateUserExtSourceLastAccessDescription copied from interface:UsersManagerBlUpdates user's userExtSource last access time in DB. We can get information which userExtSource has been used as a last one.- Specified by:
- updateUserExtSourceLastAccessin interface- UsersManagerBl
- Parameters:
- sess-
- userExtSource-
 
- 
userExtSourceExists- Specified by:
- userExtSourceExistsin interface- UsersManagerBl
 
- 
validatePasswordpublic void validatePassword(PerunSession sess, String userLogin, String loginNamespace) throws PasswordCreationFailedException, InvalidLoginException Description copied from interface:UsersManagerBlValidates the password in external system and sets user extSources and extSource related attributes. User must not exists.- Specified by:
- validatePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- userLogin- string representation of the userLogin
- loginNamespace-
- Throws:
- PasswordCreationFailedException
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
 
- 
validatePasswordpublic void validatePassword(PerunSession sess, User user, String loginNamespace) throws PasswordCreationFailedException, LoginNotExistsException, InvalidLoginException Description copied from interface:UsersManagerBlValidates the password in external system and sets user extSources and extSource related attributes. User must exists. User's login for specified namespace must exist in Perun.- Specified by:
- validatePasswordin interface- UsersManagerBl
- Parameters:
- sess-
- user-
- loginNamespace-
- Throws:
- PasswordCreationFailedException
- LoginNotExistsException- When user doesn't have login in specified namespace
- InvalidLoginException- When login of user has invalid syntax (is not allowed)
 
- 
validatePreferredEmailChangepublic String validatePreferredEmailChange(PerunSession sess, User user, UUID token) throws WrongAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, WrongReferenceAttributeValueException Description copied from interface:UsersManagerBlValidate change of user's preferred email address. New email address is set as value of urn:perun:user:attribute-def:def:preferredEmail attribute.- Specified by:
- validatePreferredEmailChangein interface- UsersManagerBl
- Parameters:
- sess- PerunSession
- user- User to validate email address for
- token- token for the email change request to validate
- Returns:
- String return new preferred email
- Throws:
- WrongAttributeValueException- If new email address is in wrong format
- WrongAttributeAssignmentException
- AttributeNotExistsException- If user:preferredEmail attribute doesn't exists.
- WrongReferenceAttributeValueException
 
- 
validateSSHKeyDescription copied from interface:UsersManagerBlValidate ssh public key, throws exception if validation fails- Specified by:
- validateSSHKeyin interface- UsersManagerBl
- Parameters:
- sess- sess
- sshKey- ssh public key to verify
- Throws:
- SSHKeyNotValidException- when validation fails
 
- 
changeOrganizationpublic void changeOrganization(PerunSession sess, User user, String newOrganizationName) throws PersonalDataChangeNotEnabledException, UserExtSourceNotExistsException Description copied from interface:UsersManagerBlChange organization from which user came to organization from user ext source.- Specified by:
- changeOrganizationin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- newOrganizationName- new organization name
- Throws:
- PersonalDataChangeNotEnabledException- If change of organization to organization from ues is not enabled.
- UserExtSourceNotExistsException- If user ext source with given organization name and required loa does not exist.
 
- 
changeOrganizationCustompublic void changeOrganizationCustom(PerunSession sess, User user, String newOrganizationName) throws PersonalDataChangeNotEnabledException Description copied from interface:UsersManagerBlChange organization from which user came to custom organization. If check from admin is required, then UserOrganizationChangeRequested audit log will be created. Otherwise, it will be set immediately.- Specified by:
- changeOrganizationCustomin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- newOrganizationName- new organization name
- Throws:
- PersonalDataChangeNotEnabledException- If change of organization to custom organization is not enabled.
 
- 
changeNamepublic void changeName(PerunSession sess, User user, String newUserName) throws UserExtSourceNotExistsException, PersonalDataChangeNotEnabledException Description copied from interface:UsersManagerBlChange user's name to user's name from user ext source.- Specified by:
- changeNamein interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- newUserName- new user's name
- Throws:
- UserExtSourceNotExistsException- If user ext source with given user's name and required loa does not exist.
- PersonalDataChangeNotEnabledException- If change of user's name to user's name from ues is not enabled.
 
- 
changeNameCustompublic void changeNameCustom(PerunSession sess, User user, String titleBefore, String firstName, String middleName, String lastName, String titleAfter) throws PersonalDataChangeNotEnabledException Description copied from interface:UsersManagerBlChange user's name to custom name. If check from admin is required, then UserNameChangeRequest audit log will be created. Otherwise, it will be set immediately.- Specified by:
- changeNameCustomin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- titleBefore- new title before
- firstName- new first name
- middleName- new middle name
- lastName- new last name
- titleAfter- new title after
- Throws:
- PersonalDataChangeNotEnabledException- If change of user's name to custom name is not enabled.
 
- 
changeEmailpublic void changeEmail(PerunSession sess, User user, String newEmail) throws UserExtSourceNotExistsException, PersonalDataChangeNotEnabledException Description copied from interface:UsersManagerBlChange user's email to email from user ext source.- Specified by:
- changeEmailin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- newEmail- new email
- Throws:
- UserExtSourceNotExistsException- If user ext source with given email and required loa does not exist.
- PersonalDataChangeNotEnabledException- If change of user's email to email from ues is not enabled.
 
- 
changeEmailCustompublic void changeEmailCustom(PerunSession sess, User user, String newEmail, String url, String lang, String path, String idp) throws PersonalDataChangeNotEnabledException Description copied from interface:UsersManagerBlChange user's email to custom email. If verification is required, then verification email will be sent. Otherwise, it will be set immediately.- Specified by:
- changeEmailCustomin interface- UsersManagerBl
- Parameters:
- sess- session
- user- user
- newEmail- new email
- url- base URL of running perun instance passed from RPC.
- lang- Language to get confirmation mail in (optional)
- path- path that is appended to the url of the verification link (optional)
- idp- authentication method appended to query parameters of verification link (optional)
- Throws:
- PersonalDataChangeNotEnabledException- If change of user's email to custom email is not enabled.
 
 
-