Package org.codelibs.fess.app.service
Class UserService
java.lang.Object
org.codelibs.fess.app.service.UserService
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
FieldsModifier and TypeFieldDescriptionprotected org.codelibs.fess.mylasta.direction.FessConfigFess configuration for system settingsprotected FessLoginAssistLogin assistance for authentication operationsprotected org.codelibs.fess.opensearch.user.exbhv.UserBhvUser behavior for database operations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassword(String username, String password) Changes the password for a user identified by username.voiddelete(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> getUserByName(String username) Retrieves a user by their username.List<org.codelibs.fess.opensearch.user.exentity.User> getUserList(UserPager userPager) Retrieves a paginated list of users based on the provided pager criteria.protected voidsetupListCondition(org.codelibs.fess.opensearch.user.cbean.UserCB cb, UserPager userPager) Sets up the search conditions for user list queries based on pager criteria.voidstore(org.codelibs.fess.opensearch.user.exentity.User user) Stores (inserts or updates) a user in the system.
-
Field Details
-
userBhv
protected org.codelibs.fess.opensearch.user.exbhv.UserBhv userBhvUser behavior for database operations -
fessLoginAssist
Login assistance for authentication operations -
fessConfig
protected org.codelibs.fess.mylasta.direction.FessConfig fessConfigFess configuration for system settings
-
-
Constructor Details
-
UserService
public UserService()Default constructor for UserService.
-
-
Method Details
-
getUserList
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
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 userpassword- 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 queryuserPager- the pager containing search criteria
-
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
-