Class ManagedUser

    • Constructor Detail

      • ManagedUser

        public ManagedUser​(String name,
                           String passwordSalt,
                           String passwordHash)
        Constructs a user with a password hash & salt provided by the caller.
        Parameters:
        name - the username (account name)
        passwordSalt - the salt to compute the password hash
        passwordHash - the result of the hashing of the salted password
    • Method Detail

      • getPasswordHash

        public String getPasswordHash()
        Gets the password hash.
        Returns:
        the password hash
      • setPasswordSalt

        public void setPasswordSalt​(String passwordSalt)
        Alters the password salt.
        Parameters:
        passwordSalt - the new password salt
      • setPasswordHash

        public void setPasswordHash​(String passwordHash)
        Alters the password hash.
        Parameters:
        passwordHash - the new password hash
      • getPasswordSalt

        public String getPasswordSalt()
        Gets the password salt.
        Returns:
        the password salt
      • setName

        public void setName​(String name)
        Alters the user's account name
        Parameters:
        name - the new account name
      • getRoles

        public Set<String> getRoles()
        Description copied from interface: User
        Gets the roles attributed to the user.
        Specified by:
        getRoles in interface User
        Returns:
        role attributed to the user
        See Also:
        Role
      • setRoles

        public void setRoles​(Set<String> roles)
        Alters the user's set of roles.
        Parameters:
        roles - the new roles
      • getPendingToken

        public @Nullable PendingToken getPendingToken()
        Gets the pending token information for this user, if any.
        Returns:
        the pending token information or null if there is none
      • setPendingToken

        public void setPendingToken​(@Nullable PendingToken pendingToken)
        Sets or clears the pending token information for this user.
        Parameters:
        pendingToken - the pending token information or null to clear it
      • getSessions

        public List<UserSession> getSessions()
        Gets the current persistent sessions for this user.
        Returns:
        the list of sessions
      • setSessions

        public void setSessions​(List<UserSession> sessions)
        Replaces the list of sessions by a new one.
        Parameters:
        sessions - the new list of sessions
      • getApiTokens

        public List<UserApiToken> getApiTokens()
        Gets the long-term API tokens for this user
        Returns:
        the API tokens
      • setApiTokens

        public void setApiTokens​(List<UserApiToken> apiTokens)
        Replaces the list of API tokens by a new one.
        Parameters:
        apiTokens - the new API tokens