public interface UserRepository
extends org.neo4j.kernel.lifecycle.Lifecycle
| Modifier and Type | Method and Description |
|---|---|
void |
assertValidUsername(String username)
Asserts whether the given username is valid or not.
|
void |
clear()
Clears all cached user data.
|
void |
create(User user)
Create a user, given that the users token is unique.
|
boolean |
delete(User user)
Deletes a user.
|
Set<String> |
getAllUsernames() |
ListSnapshot<User> |
getPersistedSnapshot()
Returns a snapshot of the current persisted user repository
|
User |
getUserByName(String username)
Return the user associated with the given username.
|
int |
numberOfUsers() |
void |
setUsers(ListSnapshot<User> users)
Replaces the users in the repository with the given users.
|
void |
update(User existingUser,
User updatedUser)
Update a user, given that the users token is unique.
|
void clear()
User getUserByName(String username)
username - the usernamevoid create(User user) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
user - the new user objectorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the username is not validIOException - if the underlying storage for users failsvoid setUsers(ListSnapshot<User> users) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
users - the new usersorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if any username is not validIOException - if the underlying storage for users failsvoid update(User existingUser, User updatedUser) throws ConcurrentModificationException, IOException, org.neo4j.kernel.api.exceptions.InvalidArgumentsException
existingUser - the existing user object, which must match the current state in this repositoryupdatedUser - the updated user objectConcurrentModificationException - if the existingUser does not match the current state in the repositoryIOException - if the underlying storage for users failsorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the existing and updated users have different namesboolean delete(User user) throws IOException
user - the user to deleteIOException - if the underlying storage for users failsint numberOfUsers()
void assertValidUsername(String username) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException
username - the username to be tested.org.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the username was invalid.ListSnapshot<User> getPersistedSnapshot() throws IOException
IOExceptionCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.