public interface UserStore
Any implementation of a User Store is expected to not perform lengthy blocking operations as it might be called on the Main Thread. All implementations of this interface should be thread safe.
Modifier and Type | Method and Description |
---|---|
Collection<SyncUser> |
allUsers()
Returns a collection of all users saved in the User store.
|
SyncUser |
get(String identity)
Retrieves specified
SyncUser . |
SyncUser |
getCurrent()
Retrieves the current
SyncUser . |
void |
put(SyncUser user)
Saves a
SyncUser object. |
void |
remove(String identity)
Removes the user from the store.
|
void put(SyncUser user)
SyncUser
object. If another user already exists, it will be replaced.
SyncUser.getIdentity()
is used as a unique identifier of a given SyncUser
.user
- SyncUser
object to store.SyncUser getCurrent()
SyncUser
.
This method will throw an exception if more than one valid, logged in users exist.
SyncUser
object or null
if not found.SyncUser get(String identity)
SyncUser
.identity
- identity of the user.SyncUser
object or null
if not found.void remove(String identity)
If the user is not found, this method does nothing.
identity
- identity of the user.Collection<SyncUser> allUsers()