Interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,​T extends BasicUser<R>>

  • Type Parameters:
    R - the generic type
    T - the generic type
    All Superinterfaces:
    org.springframework.security.core.userdetails.UserDetailsService
    All Known Implementing Classes:
    BasicUserServiceImpl

    public interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,​T extends BasicUser<R>>
    extends org.springframework.security.core.userdetails.UserDetailsService
    The Interface BasicUserService.
    • Method Detail

      • getUser

        T getUser​(long id)
        Get User by id.
        Parameters:
        id - the id
        Returns:
        the user or null
      • getUserByEmail

        T getUserByEmail​(String email)
        Get User by email.
        Parameters:
        email - the email
        Returns:
        the user
      • setRoles

        T setRoles​(T user,
                   Set<R> roles)
        Grant specified roles to user. The getDefaultUserRoles() will not be persisted.
        Parameters:
        user - the user
        roles - the roles
        Returns:
        the updated user
      • deleteUser

        void deleteUser​(T user)
        Try to delete user.
        Parameters:
        user - user to delete
      • setAccountLockLocal

        void setAccountLockLocal​(long userId,
                                 boolean locked)
                          throws NoUserFoundException
        Lock user account.
        Parameters:
        userId - the user id
        locked - Is account locked
        Throws:
        NoUserFoundException - the no user found exception
      • setAccountLock

        void setAccountLock​(long userId,
                            boolean locked)
                     throws NoUserFoundException
        Sets the account lock.
        Parameters:
        userId - the user id
        locked - the locked
        Throws:
        NoUserFoundException - the no user found exception
      • listAvailableRoles

        List<R> listAvailableRoles()
        List available roles.
        Returns:
        the list
      • getDefaultUserRoles

        Collection<R> getDefaultUserRoles()
        Get default roles assigned to users. These are transient and not persisted to the database.
        Returns:
        collection of roles assigned to all users
        Since:
        1.4
      • setAccountType

        T setAccountType​(T user,
                         BasicUser.AccountType accountType)
        Sets the account type.
        Parameters:
        user - the user
        accountType - the account type
        Returns:
        the t
      • updateLastLogin

        void updateLastLogin​(String userName)
                      throws NoUserFoundException
        Update user's last login timestamp on successful login.
        Parameters:
        userName - the user name
        Throws:
        NoUserFoundException - if username not found in the system