public interface UserStorage
User
management.Modifier and Type | Interface and Description |
---|---|
static class |
UserStorage.Order
Enum represanting different order strategies
|
Modifier and Type | Method and Description |
---|---|
User |
createUser(String loginName,
String password)
Create a new user.
|
List<User> |
findUsers(String pattern)
Returns an unmodifiable list of users, which matches the given
pattern . |
List<User> |
findUsers(String pattern,
UserStorage.Order orderBy,
boolean ascending)
Returns an unmodifiable list of users, which matches the given
pattern . |
List<User> |
getDeactivatedUsers()
Returns an unmodifiable lazy list of all deactivated users.
|
List<User> |
getDeactivatedUsers(UserStorage.Order orderBy,
boolean ascending)
Returns an unmodifiable list of all deactivated users.
|
User |
getUserByID(long id)
Gets the user with the specified ID
|
User |
getUserByLogin(String login)
Gets the user with the specified login name.
|
List<User> |
getUsers()
Returns an unmodifiable lazy list of all
User objects. |
List<User> |
getUsers(UserStorage.Order orderBy,
boolean ascending)
Returns an unmodifiable list of all users.
|
List<User> |
getUsersByID(Long[] ids)
Returns users with the given ids.
|
void |
refreshUsers()
Refreshs the internal user cache.
|
boolean |
removeUser(User user)
Returns
true if the given user could be deleted. |
void |
setUser(User user)
Write back a user to server.
|
User createUser(String loginName, String password) throws DuplicateUserException
loginName
- the login namepassword
- the passwordDuplicateUserException
- if the user already exists with the given loginNameSecurityException
- if the user isn't the server admin
List<User> getUsers()
User
objects. Use with care: methods like
contains()
or toString()
will request all users!List<User> getUsers(UserStorage.Order orderBy, boolean ascending)
List<User> getDeactivatedUsers()
contains()
or toString()
will request all users!List<User> getDeactivatedUsers(UserStorage.Order orderBy, boolean ascending)
List<User> findUsers(String pattern)
pattern
.pattern
- pattern to search in user's name. Search is done by substring comparison (no wildcards allowed)List<User> findUsers(String pattern, UserStorage.Order orderBy, boolean ascending)
pattern
.pattern
- pattern to search in user's name.ascending
- void setUser(User user)
user
- the user to writeSecurityException
- if the user isn't the server admin
boolean removeUser(User user)
true
if the given user
could be deleted. Otherwise the user
is either already deleted or currently logged in.user
- the user to deletetrue
if the user could be deleted, false
otherwise.SecurityException
- if the user isn't the server admin
@Nullable User getUserByID(long id)
id
- to specifiy the usernull
if no user exists@NotNull List<User> getUsersByID(Long[] ids)
ids
- user-ids.@Nullable User getUserByLogin(String login)
login
- to specifiy the usernull
if no user existsvoid refreshUsers()
Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408