Interface UserStorage
public interface UserStorage
FIRSTspirit
User
management.- Since:
- 4.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enum represanting different order strategies -
Method Summary
Modifier and TypeMethodDescriptioncreateUser
(String loginName, String password) Create a new user.Returns an unmodifiable list of users, which matches the givenpattern
.findUsers
(String pattern, UserStorage.Order orderBy, boolean ascending) Returns an unmodifiable list of users, which matches the givenpattern
.Returns an unmodifiable lazy list of all deactivated users.getDeactivatedUsers
(UserStorage.Order orderBy, boolean ascending) Returns an unmodifiable list of all deactivated users.@Nullable User
getUserByID
(long id) Gets the user with the specified ID@Nullable User
getUserByLogin
(String login) Gets the user with the specified login name.getUsers()
Returns an unmodifiable lazy list of allUser
objects.getUsers
(UserStorage.Order orderBy, boolean ascending) Returns an unmodifiable list of all users.getUsersByID
(Long[] ids) Returns users with the given ids.void
Refreshs the internal user cache.boolean
removeUser
(User user) Returnstrue
if the givenuser
could be deleted.void
Write back a user to server.
-
Method Details
-
createUser
Create a new user.- Parameters:
loginName
- the login namepassword
- the password- Returns:
- the created user
- Throws:
DuplicateUserException
- if the user already exists with the given loginNameSecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
getUsers
Returns an unmodifiable lazy list of allUser
objects. Use with care: methods likecontains()
ortoString()
will request all users!- Returns:
- lazy users list
- Since:
- 4.0
-
getUsers
Returns an unmodifiable list of all users.- Returns:
- the users
- Since:
- 4.0
-
getDeactivatedUsers
Returns an unmodifiable lazy list of all deactivated users. Use with care: methods likecontains()
ortoString()
will request all users!- Returns:
- lazy users list
- Since:
- 4.0.90
-
getDeactivatedUsers
Returns an unmodifiable list of all deactivated users.- Returns:
- the users
- Since:
- 4.0.90
-
findUsers
Returns an unmodifiable list of users, which matches the givenpattern
.- Parameters:
pattern
- pattern to search in user's name. Search is done by substring comparison (no wildcards allowed)- Returns:
- found users
- Since:
- 4.0
-
findUsers
Returns an unmodifiable list of users, which matches the givenpattern
.- Parameters:
pattern
- pattern to search in user's name.ascending
-- Returns:
- found users
- Since:
- 4.0
-
setUser
Write back a user to server.- Parameters:
user
- the user to write- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
removeUser
Returnstrue
if the givenuser
could be deleted. Otherwise the user is either already deleted or currently logged in.- Parameters:
user
- the user to delete- Returns:
true
if the user could be deleted,false
otherwise.- Throws:
SecurityException
- if the user isn't theserver admin
- Since:
- 4.0
-
getUserByID
Gets the user with the specified ID- Parameters:
id
- to specifiy the user- Returns:
- user with the specified ID or
null
if no user exists - Since:
- 4.0
-
getUsersByID
Returns users with the given ids. Not existing user-ids will be ignored.- Parameters:
ids
- user-ids.- Returns:
- users with the given ids.
- Since:
- 4.0
-
getUserByLogin
Gets the user with the specified login name.- Parameters:
login
- to specifiy the user- Returns:
- user with the specified login name or
null
if no user exists - Since:
- 4.0
-
refreshUsers
void refreshUsers()Refreshs the internal user cache.- Since:
- 4.0
-