public class FileUserRepository extends org.neo4j.kernel.lifecycle.LifecycleAdapter implements UserRepository
| Constructor and Description |
|---|
FileUserRepository(org.neo4j.io.fs.FileSystemAbstraction fs,
File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(User user)
Create a user, given that the users token is unique.
|
User |
findByName(String name) |
User |
findByToken(String name) |
boolean |
isValidName(String name)
Utility for API consumers to tell if #save() will accept a given username
|
boolean |
isValidToken(String token)
Utility for API consumers to tell if #save() will accept a given token
|
int |
numberOfUsers() |
void |
start() |
void |
update(User existingUser,
User updatedUser)
Update a user, given that the users token is unique.
|
public FileUserRepository(org.neo4j.io.fs.FileSystemAbstraction fs,
File file)
public User findByName(String name)
findByName in interface UserRepositorypublic User findByToken(String name)
findByToken in interface UserRepositorypublic void start()
throws Throwable
start in interface org.neo4j.kernel.lifecycle.Lifecyclestart in class org.neo4j.kernel.lifecycle.LifecycleAdapterThrowablepublic void create(User user) throws IllegalUsernameException, IllegalTokenException, IOException
UserRepositorycreate in interface UserRepositoryuser - the new user objectIllegalUsernameException - if the username is not validIllegalTokenException - if the users token is invalid or already in useIOExceptionpublic void update(User existingUser, User updatedUser) throws IllegalTokenException, ConcurrentModificationException, IOException
UserRepositoryupdate in interface UserRepositoryexistingUser - the existing user object, which must match the current state in this repositoryupdatedUser - the updated user objectIllegalTokenException - if the user token is invalid or already in useConcurrentModificationException - if the existingUser does not match the current state in the repositoryIOExceptionpublic int numberOfUsers()
numberOfUsers in interface UserRepositorypublic boolean isValidName(String name)
UserRepositoryisValidName in interface UserRepositorypublic boolean isValidToken(String token)
UserRepositoryisValidToken in interface UserRepositoryCopyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.