Package org.onebusaway.admin.service
Interface UserManagementService
-
- All Known Implementing Classes:
UserManagementServiceImpl
public interface UserManagementService
Service interface for CRUD operations on system user.- Author:
- abelsare
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
activateUser(UserDetail userDetail)
Activates a given user that has been deactivatedboolean
createUser(String userName, String password, boolean admin)
Creates a user in the system with given user name and password.boolean
createUser(String userName, String password, String role)
Creates a user in the system with given user name and password.boolean
deactivateUser(UserDetail userDetail)
Deactivates/soft deletes a given user.void
disableOperatorRole(User user)
Disables operator role for the given user.List<UserDetail>
getActiveUsersDetails()
Returns a list of user details (name, role) for every enabled user in the database An enabled user is a user where the property isDisabled=falseList<String>
getAllRoleNames()
List<UserDetail>
getInactiveUsersDetails()
Returns a list of user details (name, role) for every disabled user in the database An disabled user is a user where the property isDisabled=trueList<String>
getManagedRoleNames()
UserDetail
getUserDetail(String userName)
Fetches the user details such as user name, user role of the given userList<UserDetail>
getUserDetails(int start, int maxResults)
Returns a list of user details (name, role) for maxResults of users staring with 'start'Integer
getUserDetailsCount()
Returns the number of user details (name, role) for every user in the databaseList<String>
getUserNames(String searchTerm)
Returns a list of user names that contain the given search stringboolean
inactivateUser(UserDetail userDetail)
Inactivates a given user.boolean
updateUser(UserDetail userDetail)
Updates user in the system with new password and role.
-
-
-
Method Detail
-
getUserNames
List<String> getUserNames(String searchTerm)
Returns a list of user names that contain the given search string- Parameters:
searchString
- the search string- Returns:
- list of matching user names that contains the given search string
-
getUserDetailsCount
Integer getUserDetailsCount()
Returns the number of user details (name, role) for every user in the database- Returns:
- long number (count) of user details
-
getUserDetails
List<UserDetail> getUserDetails(int start, int maxResults)
Returns a list of user details (name, role) for maxResults of users staring with 'start'- Returns:
- list of userDetails
-
getActiveUsersDetails
List<UserDetail> getActiveUsersDetails()
Returns a list of user details (name, role) for every enabled user in the database An enabled user is a user where the property isDisabled=false- Returns:
- list of userDetails
-
getInactiveUsersDetails
List<UserDetail> getInactiveUsersDetails()
Returns a list of user details (name, role) for every disabled user in the database An disabled user is a user where the property isDisabled=true- Returns:
- list of userDetails
-
getUserDetail
UserDetail getUserDetail(String userName)
Fetches the user details such as user name, user role of the given user- Parameters:
userName
- user whose details are desired- Returns:
- user details of the desired user
-
disableOperatorRole
void disableOperatorRole(User user)
Disables operator role for the given user. A user can either be an admin or operator but not both.- Parameters:
user
- system user
-
createUser
boolean createUser(String userName, String password, boolean admin)
Creates a user in the system with given user name and password. Assigns admin role to the created user if admin flag is set- Parameters:
userName
- user name of the new userpassword
- password of the new useradmin
- true if user beign created is admin- Returns:
- true if user creation is successful, false otherwise
-
createUser
boolean createUser(String userName, String password, String role)
Creates a user in the system with given user name and password. Assigns admin role to the created user if admin flag is set- Parameters:
userName
- user name of the new userpassword
- password of the new userrole
- role of the new user- Returns:
- true if user creation is successful, false otherwise
-
updateUser
boolean updateUser(UserDetail userDetail)
Updates user in the system with new password and role. Only updates the user record if it is found in the system.- Parameters:
userDetail
- userDetails such as username, password etc- Returns:
- true if update operation succeeds, false otherwise
-
deactivateUser
boolean deactivateUser(UserDetail userDetail)
Deactivates/soft deletes a given user. This action is un-reversible. Called "delete" in the UI- Parameters:
userDetail
- userDetails such as id, username etc- Returns:
- true if soft delete operation succeeds, false otherwise
-
inactivateUser
boolean inactivateUser(UserDetail userDetail)
Inactivates a given user. User can be activated again.- Parameters:
userDetail
- userDetails such as id, username etc- Returns:
- true if setting isDisabled property succeeds, false otherwise
-
activateUser
boolean activateUser(UserDetail userDetail)
Activates a given user that has been deactivated- Parameters:
userDetail
- userDetails such as id, username etc- Returns:
- true if setting isDisabled property succeeds, false otherwise
-
-