Class UserService

java.lang.Object
org.codelibs.fess.app.service.UserService

public class UserService extends Object
Service class for managing user operations in the Fess search system. This service provides CRUD operations for user management, including user authentication, password management, and user listing with pagination support.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.codelibs.fess.mylasta.direction.FessConfig
    Fess configuration for system settings
    protected FessLoginAssist
    Login assistance for authentication operations
    protected org.codelibs.fess.opensearch.user.exbhv.UserBhv
    User behavior for database operations
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for UserService.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    changePassword(String username, String password)
    Changes the password for a user identified by username.
    void
    delete(org.codelibs.fess.opensearch.user.exentity.User user)
    Deletes a user from the system.
    List<org.codelibs.fess.opensearch.user.exentity.User>
    Retrieves a list of all available users in the system.
    org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.user.exentity.User>
    Retrieves a user by their unique identifier.
    org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.user.exentity.User>
    Retrieves a user by their username.
    List<org.codelibs.fess.opensearch.user.exentity.User>
    Retrieves a paginated list of users based on the provided pager criteria.
    protected void
    setupListCondition(org.codelibs.fess.opensearch.user.cbean.UserCB cb, UserPager userPager)
    Sets up the search conditions for user list queries based on pager criteria.
    void
    store(org.codelibs.fess.opensearch.user.exentity.User user)
    Stores (inserts or updates) a user in the system.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • userBhv

      protected org.codelibs.fess.opensearch.user.exbhv.UserBhv userBhv
      User behavior for database operations
    • fessLoginAssist

      protected FessLoginAssist fessLoginAssist
      Login assistance for authentication operations
    • fessConfig

      protected org.codelibs.fess.mylasta.direction.FessConfig fessConfig
      Fess configuration for system settings
  • Constructor Details

    • UserService

      public UserService()
      Default constructor for UserService.
  • Method Details

    • getUserList

      public List<org.codelibs.fess.opensearch.user.exentity.User> getUserList(UserPager userPager)
      Retrieves a paginated list of users based on the provided pager criteria. Updates the pager with pagination information including total count and page navigation.
      Parameters:
      userPager - the pager containing search criteria and pagination settings
      Returns:
      a list of users matching the criteria
    • getUser

      public org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.user.exentity.User> getUser(String id)
      Retrieves a user by their unique identifier. Loads the user through the authentication manager for complete user data.
      Parameters:
      id - the unique identifier of the user
      Returns:
      an OptionalEntity containing the user if found
    • getUserByName

      public org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.user.exentity.User> getUserByName(String username)
      Retrieves a user by their username.
      Parameters:
      username - the username to search for
      Returns:
      an OptionalEntity containing the user if found
    • store

      public void store(org.codelibs.fess.opensearch.user.exentity.User user)
      Stores (inserts or updates) a user in the system. Handles user authentication setup and database persistence. If the surname is blank, it will be set to the user's name.
      Parameters:
      user - the user entity to store
    • changePassword

      public void changePassword(String username, String password)
      Changes the password for a user identified by username. Updates both the authentication manager and the database with the new encrypted password.
      Parameters:
      username - the username of the user
      password - the new password in plain text
      Throws:
      FessUserNotFoundException - if the user is not found
    • delete

      public void delete(org.codelibs.fess.opensearch.user.exentity.User user)
      Deletes a user from the system. Removes the user from both the authentication manager and the database.
      Parameters:
      user - the user entity to delete
    • setupListCondition

      protected void setupListCondition(org.codelibs.fess.opensearch.user.cbean.UserCB cb, UserPager userPager)
      Sets up the search conditions for user list queries based on pager criteria. Configures the condition bean with search filters and ordering.
      Parameters:
      cb - the condition bean for the user query
      userPager - the pager containing search criteria
    • getAvailableUserList

      public List<org.codelibs.fess.opensearch.user.exentity.User> getAvailableUserList()
      Retrieves a list of all available users in the system. Returns up to the maximum configured number of users.
      Returns:
      a list of all available users