Interface UsersManagerImplApi

All Known Implementing Classes:
UsersManagerImpl

public interface UsersManagerImplApi
UsersManager can find users.
Author:
Michal Prochazka, Slavek Licehammer, Zora Sebestianova, Sona Mastrakova
  • Method Details

    • addSpecificUserOwner

      void addSpecificUserOwner(PerunSession sess, User user, User specificUser)
      Add specificUser owner (the user). If not exists, create new ownership. If exists, only enable ownership for user and specificUser
      Parameters:
      sess -
      user - the user
      specificUser - the specificUser
      Throws:
      InternalErrorException
    • addUserExtSource

      UserExtSource addUserExtSource(PerunSession perunSession, User user, UserExtSource userExtSource)
      Adds user's external sources.
      Parameters:
      perunSession -
      user -
      userExtSource -
      Returns:
      user external source with userExtSource.id filled
      Throws:
      InternalErrorException
    • anonymizeUser

      User anonymizeUser(PerunSession perunSession, User user)
      Anonymizes users data in DB - sets names and titles to NULL and sets anonymized flag to true.
      Parameters:
      perunSession -
      user -
      Returns:
      user
      Throws:
      InternalErrorException
    • blockLogin

      void blockLogin(PerunSession sess, String login, String namespace, Integer relatedUserId) throws LoginIsAlreadyBlockedException
      Block login for given namespace or block login globally (if no namespace is selected)
      Parameters:
      sess -
      login - login to be blocked
      namespace - namespace where the login should be blocked (null means block the login globally)
      relatedUserId - id of the user related to the login or null if the relatedUserId should not be stored
      Throws:
      LoginIsAlreadyBlockedException
    • checkPasswordResetRequestIsValid

      void checkPasswordResetRequestIsValid(PerunSession sess, UUID uuid) throws PasswordResetLinkExpiredException, PasswordResetLinkNotValidException
      Checks if the password reset request link is valid. The request is valid, if it was created, never used and hasn't expired yet.
      Parameters:
      sess - PerunSession
      uuid - UUID of the request to check
      Throws:
      PasswordResetLinkExpiredException - when the password reset request expired
      PasswordResetLinkNotValidException - when the password reset request was already used or has never existed
    • checkReservedLogins

      void checkReservedLogins(PerunSession sess, String namespace, String login, boolean ignoreCase) throws AlreadyReservedLoginException
      Check if login exists in specified namespace or in any namespace (if namespace is null).
      Parameters:
      sess -
      namespace - namespace for login, null for all namespace
      login - login to check
      ignoreCase - TRUE to perform case-insensitive check
      Throws:
      InternalErrorException
      AlreadyReservedLoginException - throw this exception if login already exist in table of reserved logins
    • checkUserExists

      void checkUserExists(PerunSession perunSession, User user) throws UserNotExistsException
      Check if user exists in underlaying data source.
      Parameters:
      perunSession -
      user -
      Throws:
      InternalErrorException
      UserNotExistsException
    • checkUserExtSourceExists

      void checkUserExtSourceExists(PerunSession perunSession, UserExtSource userExtSource) throws UserExtSourceNotExistsException
      Check if userExtSource exists in underlaying data source by identity (login/extSource combination)
      Parameters:
      perunSession -
      userExtSource -
      Throws:
      InternalErrorException
      UserExtSourceNotExistsException
    • checkUserExtSourceExistsById

      void checkUserExtSourceExistsById(PerunSession perunSession, int id) throws UserExtSourceNotExistsException
      Check if userExtSource exists in underlaying data source by its ID.
      Parameters:
      perunSession -
      id -
      Throws:
      InternalErrorException
      UserExtSourceNotExistsException
    • createUser

      User createUser(PerunSession perunSession, User user)
      Creates the user, stores it in the DB. This method will fill id and uuid to the given user object, but returns a new user object loaded from the DB.
      Parameters:
      perunSession -
      user - user bean with filled properties
      Returns:
      user with user.id filled
      Throws:
      InternalErrorException
    • deleteReservedLogin

      void deleteReservedLogin(PerunSession sess, Pair<String,String> login)
      Deletes given login reservations.

      Reserved logins must be removed from external systems (e.g. KDC) BEFORE calling this method via deletePassword() in UsersManager.

      Parameters:
      sess -
      login - login (pair namespace and login) to delete
    • deleteReservedLoginsForNamespace

      void deleteReservedLoginsForNamespace(PerunSession sess, String namespace)
      Deletes all reserved logins in given namespace
      Parameters:
      sess - PerunSession
      namespace - Namespace
    • deleteSponsorLinks

      void deleteSponsorLinks(PerunSession sess, User sponsor)
      Deletes all links to sponsors, even those marked as inactive.
      Parameters:
      sess - perun session
      sponsor - sponsor
      Throws:
      InternalErrorException
    • deleteUser

      Deletes user (normal or specific) including all relations to other users (normal,specific,sponsor)
      Parameters:
      perunSession - Session for authz
      user - User to delete
      Throws:
      InternalErrorException
      UserAlreadyRemovedException - When user is already deleted
      SpecificUserAlreadyRemovedException - When specific user is already deleted
    • deleteUsersApplications

      void deleteUsersApplications(User user)
      Delete all applications and submitted data for specific user.
      Parameters:
      user - for which delete applications and submitted data
      Throws:
      InternalErrorException
    • deleteUsersReservedLogins

      void deleteUsersReservedLogins(User user)
      Delete all reserved logins for specific user (pair is namespace and login)
      Parameters:
      user - for which get delete reserved logins
      Throws:
      InternalErrorException
    • disableOwnership

      void disableOwnership(PerunSession sess, User user, User specificUser)
      Set ownership for user and specificUser to DISABLE (1).
      Parameters:
      sess -
      user -
      specificUser -
      Throws:
      InternalErrorException
    • enableOwnership

      void enableOwnership(PerunSession sess, User user, User specificUser)
      Set ownership for user and specificUser to ENABLE (0).
      Parameters:
      sess -
      user -
      specificUser -
      Throws:
      InternalErrorException
    • findUsers

      List<User> findUsers(PerunSession sess, String searchString)
      Returns list of users who matches the searchString, searching name, id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).
      Parameters:
      sess - perun session
      searchString - it will be looking for this search string in the specific parameters in DB
      Returns:
      list of users
    • findUsersByExactMatch

      List<User> findUsersByExactMatch(PerunSession sess, String searchString)
      Returns list of users who matches the searchString, searching name (exact match), id, uuid, member attributes, user attributes and userExtSource attributes (listed in perun.properties).
      Parameters:
      sess - perun session
      searchString - it will be looking for this search string in the specific parameters in DB
      Returns:
      list of users
    • findUsersByExactName

      List<User> findUsersByExactName(PerunSession sess, String searchString)
      Returns list of users who exactly matches the searchString
      Parameters:
      sess -
      searchString -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • findUsersByName

      List<User> findUsersByName(PerunSession sess, String searchString)
      Returns list of users who matches the searchString
      Parameters:
      sess -
      searchString -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • findUsersByName

      List<User> findUsersByName(PerunSession sess, String titleBefore, String firstName, String middleName, String lastName, String titleAfter)
      Returns list of users who matches the fields.
      Parameters:
      sess -
      titleBefore -
      firstName -
      middleName -
      lastName -
      titleAfter -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • findUsersWithExtSourceAttributeValueEnding

      List<User> findUsersWithExtSourceAttributeValueEnding(PerunSessionImpl sess, String attributeName, String valueEnd, List<String> excludeValueEnds)
      Implements search for #UsersManagerBl.findUsersWithExtSourceAttributeValueEnding().
    • getActiveUserExtSources

      List<UserExtSource> 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.
      Parameters:
      sess -
      user - user to get extSources for
      Returns:
      list of active user extSources (not older than now - m)
      Throws:
      InternalErrorException
    • getAllBlockedLoginsInNamespaces

      List<BlockedLogin> getAllBlockedLoginsInNamespaces(PerunSession sess)
      Returns all blocked logins in namespaces (if namespace is null, then this login is blocked globally)
      Parameters:
      sess -
      Returns:
      list of all blocked logins in namespaces
    • getAllUserExtSourcesByTypeAndLogin

      List<UserExtSource> getAllUserExtSourcesByTypeAndLogin(PerunSession sess, String extType, String extLogin)
      Gets list of all users external sources by specific type and extLogin.
      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
      Throws:
      InternalErrorException
    • getAllowedResources

      List<Resource> getAllowedResources(PerunSession sess, User user)
      Return all resources, where user is allowed by all his members.
      Parameters:
      sess -
      user -
      Returns:
      All resources where user is allowed
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession sess, User user)
      Return all resources, where user is assigned through all his members.
      Parameters:
      sess -
      user -
      Returns:
      All resources where user is assigned
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession sess, Facility facility, User user)
      Return all resources of specified facility, where user is assigned through all his members.
      Parameters:
      sess -
      facility -
      user -
      Returns:
      All resources where user is assigned
    • getAssignedRichResources

      List<RichResource> getAssignedRichResources(PerunSession sess, User user)
      Return all rich resources, where user is assigned through all his members.
      Parameters:
      sess -
      user -
      Returns:
      All resources where user is assigned
    • getAssociatedResources

      List<Resource> getAssociatedResources(PerunSession sess, Facility facility, User user)
      Return all resources of specified facility with which user is associated through all his members. Does not require ACTIVE group-resource assignment.
      Parameters:
      sess -
      facility -
      user -
      Returns:
      All resources with which user is associated
    • getAssociatedResources

      List<Resource> 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).
      Parameters:
      sess -
      user -
      Returns:
      list of resources with which user is associated
    • getBlockedLoginById

      BlockedLogin getBlockedLoginById(PerunSession sess, int id) throws LoginIsNotBlockedException
      Get blocked login by id
      Parameters:
      sess - session
      id - id of blocked login
      Returns:
      blocked login
      Throws:
      LoginIsNotBlockedException - when login is not blocked
    • getBlockedLoginsPage

      Paginated<BlockedLogin> getBlockedLoginsPage(PerunSession sess, BlockedLoginsPageQuery query)
      Get page of blocked logins.
      Parameters:
      sess - session
      query - query with page information
      Returns:
      page of requested blocked logins
    • getGroupsWhereUserIsAdmin

      List<Group> getGroupsWhereUserIsAdmin(PerunSession perunSession, 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.
      Parameters:
      perunSession -
      user -
      Returns:
      list of Groups, where user or some of his groups is an Administrator
      Throws:
      InternalErrorException
    • getGroupsWhereUserIsAdmin

      List<Group> 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.
      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
      Throws:
      InternalErrorException
    • getIdOfBlockedLogin

      int getIdOfBlockedLogin(PerunSession sess, String login, String namespace)
      Return ID of blocked login
      Parameters:
      sess - session
      login - login
      namespace - namespace
      Returns:
      id of login blocked in specified namespace
    • getPasswordManagerModule

      PasswordManagerModule getPasswordManagerModule(PerunSession session, String namespace)
      Return instance of PasswordManagerModule for specified namespace or NULL if class for module is not found. Throws exception if class can't be instantiated.
      Parameters:
      session - Session with authz
      namespace - Namespace to get PWDMGR module.
      Returns:
      Instance of password manager module or NULL if not exists for passed namespace.
      Throws:
      InternalErrorException - When module can't be instantiated.
    • getPendingPreferredEmailChanges

      List<String> getPendingPreferredEmailChanges(PerunSession sess, User user)
      Return 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.

      Parameters:
      sess - PerunSession
      user - User to check pending request for
      Returns:
      List user's email addresses pending validation
    • getPreferredEmailChangeRequest

      String getPreferredEmailChangeRequest(PerunSession sess, User user, UUID uuid)
      Get new preferred email value from user's original request
      Parameters:
      sess - PerunSession
      user - User to get new email address for
      uuid - UUID of the email change request
      Returns:
      String return new preferred email
      Throws:
      InternalErrorException
    • getRelatedUserIdByBlockedLoginInNamespace

      Integer getRelatedUserIdByBlockedLoginInNamespace(PerunSession sess, String login, String namespace) throws LoginIsNotBlockedException
      Get user id of the user who was related to the given login in the past
      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
    • getReservedLoginsByApp

      List<Pair<String,String>> getReservedLoginsByApp(PerunSession sess, int appId)
      Gets reserved logins which used in the given application.
      Parameters:
      sess -
      appId -
      Returns:
      list of logins (Pair: left - namespace, right - login)
    • getReservedLoginsOnlyByGivenApp

      List<Pair<String,String>> getReservedLoginsOnlyByGivenApp(PerunSession sess, int appId)
      Gets reserved logins which can be deleted - they are used only in the given application.
      Parameters:
      sess -
      appId -
      Returns:
      list of logins (Pair: left - namespace, right - login)
    • getSpecificUsers

      List<User> getSpecificUsers(PerunSession sess)
      Return all specific Users (only specific users) Return also users who has no owners.
      Parameters:
      sess -
      Returns:
      list of all specific users in perun
      Throws:
      InternalErrorException
    • getSpecificUsersByUser

      List<User> getSpecificUsersByUser(PerunSession sess, User user)
      Return all specificUsers who are owned by the user and their ownership is not in status disabled
      Parameters:
      sess -
      user - the user
      Returns:
      list of specificUsers who are owned by the user
      Throws:
      InternalErrorException
    • getSponsors

      List<User> getSponsors(PerunSession sess, Member sponsoredMember)
      Gets list of user that sponsored a member.
      Parameters:
      sess - perun session
      sponsoredMember - member which is sponsored
      Returns:
      list of users that sponsored a member.
      Throws:
      InternalErrorException
    • getSponsorsForSponsoredMembersInVo

      Map<Integer,List<Pair<User,Sponsorship>>> 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.
      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
    • getUserById

      User getUserById(PerunSession perunSession, int id) throws UserNotExistsException
      Returns user by its id.
      Parameters:
      perunSession -
      id -
      Returns:
      user
      Throws:
      UserNotExistsException
      InternalErrorException
    • getUserByMember

      User getUserByMember(PerunSession perunSession, Member member)
      Returns user by VO member.
      Parameters:
      perunSession -
      member -
      Returns:
      user
      Throws:
      InternalErrorException
    • getUserByUserExtSource

      User getUserByUserExtSource(PerunSession perunSession, UserExtSource userExtSource) throws UserNotExistsException
      Returns user by his login in external source.
      Parameters:
      perunSession -
      userExtSource -
      Returns:
      user by its userExtSource or throws UserNotExistsException
      Throws:
      InternalErrorException
      UserNotExistsException
    • getUserExtSourceByExtLogin

      UserExtSource getUserExtSourceByExtLogin(PerunSession perunSession, ExtSource source, String extLogin) throws UserExtSourceNotExistsException
      Gets user's external source by the user's external login and external source.
      Parameters:
      perunSession -
      source -
      extLogin -
      Returns:
      user external source object
      Throws:
      InternalErrorException
      UserExtSourceNotExistsException
    • getUserExtSourceById

      UserExtSource getUserExtSourceById(PerunSession sess, int id) throws UserExtSourceNotExistsException
      Get the user ext source by its id.
      Parameters:
      sess -
      id -
      Returns:
      user external source for the id
      Throws:
      InternalErrorException
      UserExtSourceNotExistsException
    • getUserExtSourceByUniqueAttributeValue

      UserExtSource getUserExtSourceByUniqueAttributeValue(PerunSession sess, int attrId, String uniqueValue) throws UserExtSourceNotExistsException
      Return userExtSource for specific attribute id and unique value. If not found, throw and exception.

      It looks for exactly one value of the specific attribute type: - Integer -> exactly match - String -> exactly match - Map -> exactly match of "key=value" - ArrayList -> exactly match of one of the value

      Parameters:
      sess -
      attrId - attribute id we are looking for
      uniqueValue - value used for searching
      Returns:
      userExtSource found by attribute id and it's unique value
      Throws:
      InternalErrorException - if Runtime exception has been thrown
      UserExtSourceNotExistsException - if userExtSource can't be found
    • getUserExtSources

      List<UserExtSource> getUserExtSources(PerunSession sess, User user)
      Get List of user ext sources by user
      Parameters:
      sess - session
      user - owner of extSources
      Returns:
      List of user's UserExtSources
      Throws:
      InternalErrorException
    • getUserExtSourcesByIds

      List<UserExtSource> getUserExtSourcesByIds(PerunSession sess, List<Integer> ids)
      Gets user ext sources by their ids. Silently skips non-existing user ext sources.
      Parameters:
      sess -
      ids -
      Returns:
      List of UserExtSources with specified ids
      Throws:
      InternalErrorException
    • getUsers

      List<User> getUsers(PerunSession sess)
      Returns all users (included specific users).
      Parameters:
      sess -
      Returns:
      list of all users
      Throws:
      InternalErrorException
    • getUsersByAttribute

      List<User> getUsersByAttribute(PerunSession sess, Attribute attribute)
      Returns all users who have set the attribute with the value. Searching only def and opt attributes.
      Parameters:
      sess -
      attribute -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • getUsersByAttribute

      List<User> getUsersByAttribute(PerunSession sess, Attribute attribute, boolean ignoreCase)
      Returns all users who have set the attribute with the value IGNORING CASE in the comparison. Searching only def and opt attributes.
      Parameters:
      sess -
      attribute -
      ignoreCase - TRUE to perform case-insensitive check
      Returns:
      list of users
      Throws:
      InternalErrorException
    • getUsersByAttributeValue

      List<User> getUsersByAttributeValue(PerunSession sess, AttributeDefinition attributeDefintion, 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.
      Parameters:
      sess -
      attributeDefintion -
      attributeValue -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • getUsersByExtSourceTypeAndLogin

      List<User> getUsersByExtSourceTypeAndLogin(PerunSession perunSession, String extSourceType, String login)
      Get all the users who have given type of the ExtSource and login.
      Parameters:
      perunSession - perun session
      extSourceType - type of the user extSource
      login - login of the user
      Returns:
      all users with given parameters
      Throws:
      InternalErrorException
    • getUsersByIds

      List<User> getUsersByIds(PerunSession sess, List<Integer> usersIds)
      Gets users by their ids. Silently skips non-existing users.
      Parameters:
      sess -
      usersIds -
      Returns:
      List of users with specified ids
      Throws:
      InternalErrorException
    • getUsersBySpecificUser

      List<User> getUsersBySpecificUser(PerunSession sess, User specificUser)
      Return all users who owns the specificUser and their ownership is not in status disabled
      Parameters:
      sess -
      specificUser - the specific User
      Returns:
      list of user who owns the specificUser
      Throws:
      InternalErrorException
    • getUsersByVo

      List<User> getUsersByVo(PerunSession sess, Vo vo)
      Return users which have member in VO.
      Parameters:
      sess -
      vo -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • getUsersCount

      int getUsersCount(PerunSession perunSession)
      Get count of all users.
      Parameters:
      perunSession -
      Returns:
      count of all users
      Throws:
      InternalErrorException
    • getUsersPage

      Paginated<User> getUsersPage(PerunSession sess, UsersPageQuery query)
      Get page of users.
      Parameters:
      sess - session
      query - query with page information
      Returns:
      page of requested users
    • getUsersReservedLogins

      List<Pair<String,String>> getUsersReservedLogins(User user)
      Return list of all reserved logins for specific user (pair is namespace and login)
      Parameters:
      user - for which get reserved logins
      Returns:
      list of pairs namespace and login
      Throws:
      InternalErrorException
    • getUsersWithoutVoAssigned

      List<User> getUsersWithoutVoAssigned(PerunSession sess)
      Returns all users who are not member of any VO.
      Parameters:
      sess -
      Returns:
      list of users who are not member of any VO
      Throws:
      InternalErrorException
    • getVosWhereUserIsAdmin

      List<Vo> getVosWhereUserIsAdmin(PerunSession perunSession, User user)
      Returns list of VOs, where the user is an Administrator. Including VOs, where the user is a VALID member of authorized group.
      Parameters:
      perunSession -
      user -
      Returns:
      list of VOs, where the user is an Administrator.
      Throws:
      InternalErrorException
    • getVosWhereUserIsMember

      List<Vo> getVosWhereUserIsMember(PerunSession sess, User user)
      Returns list of Vos' ids, where the user is member.
      Parameters:
      sess -
      user -
      Returns:
      list of Vos, where the user is member
      Throws:
      InternalErrorException
    • isLoginBlocked

      boolean isLoginBlocked(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. Globally banned logins are ALWAYS case-insensitive (ignoreCase value is not taken into account for them).
      Parameters:
      sess -
      login - login to check
      ignoreCase -
      Returns:
      true if login is blocked
    • isLoginBlockedForNamespace

      boolean isLoginBlockedForNamespace(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. Globally banned logins are ALWAYS case-insensitive.
      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)
    • isLoginBlockedGlobally

      boolean isLoginBlockedGlobally(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.
      Parameters:
      sess -
      login - login to check
      Returns:
      true if login is blocked globally
    • isLoginReserved

      boolean isLoginReserved(PerunSession sess, String namespace, String login, boolean ignoreCase)
      Return true if login is already reserved in specified namespace or in any namespace (if namespace is null), false if not.
      Parameters:
      sess -
      namespace - namespace for login, null for all namespace
      login - login to check
      ignoreCase - TRUE to perform case-insensitive check
      Returns:
      true if login exist, false if not exist
      Throws:
      InternalErrorException
    • isUserAnonymized

      boolean isUserAnonymized(PerunSession sess, User user)
      Checks whether user has been anonymized or not.
      Parameters:
      sess -
      user -
      Returns:
      true if user has been anonymized, false otherwise.
    • isUserPerunAdmin

      @Deprecated boolean isUserPerunAdmin(PerunSession sess, User user)
      Deprecated.
      Returns true if the user is PERUNADMIN.
      Parameters:
      sess -
      user -
      Returns:
      true if the user is PERUNADMIN, false otherwise.
      Throws:
      InternalErrorException
    • loadPasswordResetRequest

      Returns only valid password reset request with specified UUID. Validity is determined by time since request creation and actual usage (only once).

      If no valid entry is found, exception is thrown. Entry is invalidated once loaded.

      Parameters:
      sess - PerunSession
      uuid - UUID of the request to get
      Returns:
      Map with 3 keys: - "user_id" = ID of the user who requested this password reset, value is Integer - "namespace" = namespace user wants to reset password, value is String - "mail" = mail used for notification, value is String
      Throws:
      PasswordResetLinkExpiredException - when the password reset request expired
      PasswordResetLinkNotValidException - when the password reset request was already used or has never existed
    • removeAllAuthorships

      void removeAllAuthorships(PerunSession sess, User user)
      Removes all authorships of user when user is deleted from DB (author records on all his publications).
      Parameters:
      sess -
      user -
      Throws:
      InternalErrorException - thrown when runtime exception
    • removeAllPasswordResetRequests

      void removeAllPasswordResetRequests(PerunSession sess, User user)
      Removes all password reset requests associated with user. This is used when deleting user from Perun.
      Parameters:
      sess - PerunSession
      user - User to remove all pwdreset requests
      Throws:
      InternalErrorException
    • removeAllPreferredEmailChangeRequests

      void removeAllPreferredEmailChangeRequests(PerunSession sess, User user)
      Removes all mail change requests related to user.
      Parameters:
      sess - PerunSession
      user - User to remove preferred email change requests for
      Throws:
      InternalErrorException - if any exception in DB occur
    • removeAllUserExtSources

      void removeAllUserExtSources(PerunSession perunSession, User user)
      Removes all user's external sources.
      Parameters:
      perunSession -
      user -
      Throws:
      InternalErrorException
    • removeSpecificUserOwner

      void removeSpecificUserOwner(PerunSession sess, User user, User specificUser) throws SpecificUserOwnerAlreadyRemovedException
      Remove specificUser owner (the user) Only disable ownership of user and specificUser
      Parameters:
      sess -
      user - the user
      specificUser - the specificUser
      Throws:
      InternalErrorException
      SpecificUserOwnerAlreadyRemovedException - if there are 0 rows affected by deleting from DB
    • removeUserExtSource

      void removeUserExtSource(PerunSession perunSession, User user, UserExtSource userExtSource) throws UserExtSourceAlreadyRemovedException
      Removes user's external sources.
      Parameters:
      perunSession -
      user -
      userExtSource -
      Throws:
      InternalErrorException
      UserExtSourceAlreadyRemovedException - if there are 0 rows affected by deleting from DB
    • requestPreferredEmailChange

      UUID requestPreferredEmailChange(PerunSession sess, User user, String email)
      Store request of change of user's preferred email address. Change in attribute value is not done, until email address is verified by link in email notice. (urn:perun:user:attribute-def:def:preferredEmail)
      Parameters:
      sess -
      user -
      email -
      Returns:
      UUID of change request
      Throws:
      InternalErrorException
    • setSpecificUserType

      User setSpecificUserType(PerunSession sess, User user, SpecificUserType specificUserType)
      Set flag for specific user type for the user.
      Parameters:
      sess -
      user - the user
      specificUserType - specific type of user
      Returns:
      Throws:
      InternalErrorException
    • specificUserOwnershipExists

      boolean specificUserOwnershipExists(PerunSession sess, User user, User specificUser)
      Return true if ownership between user and specificUser already exists. Return false if not.
      Parameters:
      sess -
      user -
      specificUser -
      Returns:
      true if ownership exists, false if not
      Throws:
      InternalErrorException
    • unblockLogin

      void unblockLogin(PerunSession sess, String login, String namespace) throws LoginIsNotBlockedException
      Unblock login for given namespace or unblock login globally (if no namespace is selected)
      Parameters:
      sess -
      login - login to be unblocked
      namespace - namespace where the login should be unblocked (null means unblock the login globally)
      Throws:
      LoginIsNotBlockedException
    • unblockLoginsById

      void unblockLoginsById(PerunSession sess, List<Integer> loginIds)
      Unblock logins by id globally, or in the namespace they were initially blocked.
      Parameters:
      sess - session
      loginIds - list of login ids
    • unblockLoginsForNamespace

      void unblockLoginsForNamespace(PerunSession sess, String namespace)
      Unblock all logins for given namespace
      Parameters:
      sess - PerunSession
      namespace - Namespace or null for globally blocked
    • unsetSpecificUserType

      User unsetSpecificUserType(PerunSession sess, User user, SpecificUserType specificUserType)
      Unset flag for specific user type for the user.
      Parameters:
      sess -
      user - the user
      specificUserType - specific type of user
      Returns:
      Throws:
      InternalErrorException
    • updateNameTitles

      User updateNameTitles(PerunSession perunSession, User user)
      Updates 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.
      Parameters:
      perunSession -
      user -
      Returns:
      updated user with new titles before/after name
      Throws:
      InternalErrorException
    • updateUser

      User updateUser(PerunSession perunSession, User user)
      Updates users data in DB.
      Parameters:
      perunSession -
      user -
      Returns:
      updated user
      Throws:
      InternalErrorException
    • updateUserExtSource

      UserExtSource updateUserExtSource(PerunSession perunSession, UserExtSource userExtSource) throws UserExtSourceExistsException
      Updates user;s userExtSource in DB.
      Parameters:
      perunSession -
      userExtSource -
      Returns:
      updated user
      Throws:
      InternalErrorException
      UserExtSourceExistsException - When UES with same login/extSource already exists.
    • updateUserExtSourceLastAccess

      void updateUserExtSourceLastAccess(PerunSession perunSession, UserExtSource userExtSource)
      Updates user's userExtSource last access time in DB.
      Parameters:
      perunSession -
      userExtSource -
      Throws:
      InternalErrorException
    • userExists

      boolean userExists(PerunSession perunSession, User user)
      Check if user exists in underlaying data source.
      Parameters:
      perunSession -
      user - user to check
      Returns:
      true if user exists in underlaying data source, false otherwise
      Throws:
      InternalErrorException
    • userExtSourceExists

      boolean userExtSourceExists(PerunSession perunSession, UserExtSource userExtSource)
      Check if userExtSource exists in underlaying data source.
      Parameters:
      perunSession -
      userExtSource - userExtSource to check
      Returns:
      true if userExtSource exists in underlaying data source, false otherwise
      Throws:
      InternalErrorException