public abstract class AbstractUserRepository extends org.neo4j.kernel.lifecycle.LifecycleAdapter implements UserRepository
| Constructor and Description |
|---|
AbstractUserRepository() |
| 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() |
User |
getUserByName(String username)
Return the user associated with the given username.
|
int |
numberOfUsers() |
void |
setUsers(ListSnapshot<User> usersSnapshot)
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.
|
init, shutdown, start, stopequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPersistedSnapshotpublic void clear()
UserRepositoryclear in interface UserRepositorypublic User getUserByName(String username)
UserRepositorygetUserByName in interface UserRepositoryusername - the usernamepublic void create(User user) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
UserRepositorycreate in interface UserRepositoryuser - the new user objectorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the username is not validIOException - if the underlying storage for users failspublic void setUsers(ListSnapshot<User> usersSnapshot) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
UserRepositorysetUsers in interface UserRepositoryusersSnapshot - the new usersorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if any username is not validIOException - if the underlying storage for users failspublic void update(User existingUser, User updatedUser) throws ConcurrentModificationException, IOException, org.neo4j.kernel.api.exceptions.InvalidArgumentsException
UserRepositoryupdate in interface UserRepositoryexistingUser - 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 namespublic boolean delete(User user) throws IOException
UserRepositorydelete in interface UserRepositoryuser - the user to deleteIOException - if the underlying storage for users failspublic int numberOfUsers()
numberOfUsers in interface UserRepositorypublic void assertValidUsername(String username) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException
UserRepositoryassertValidUsername in interface UserRepositoryusername - the username to be tested.org.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the username was invalid.public Set<String> getAllUsernames()
getAllUsernames in interface UserRepositoryCopyright © 2002–2018 The Neo4j Graph Database Project. All rights reserved.