public abstract class AbstractRoleRepository extends org.neo4j.kernel.lifecycle.LifecycleAdapter implements RoleRepository
| Constructor and Description |
|---|
AbstractRoleRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertValidRoleName(String name)
Asserts whether the given role name is valid or not.
|
void |
clear()
Clears all cached role data.
|
void |
create(RoleRecord role)
Create a role, given that the roles token is unique.
|
boolean |
delete(RoleRecord role)
Deletes a role.
|
Set<String> |
getAllRoleNames() |
RoleRecord |
getRoleByName(String roleName) |
Set<String> |
getRoleNamesByUsername(String username) |
int |
numberOfRoles() |
void |
removeUserFromAllRoles(String username) |
void |
setRoles(org.neo4j.server.security.auth.ListSnapshot<RoleRecord> rolesSnapshot)
Replaces the roles in the repository with the given roles.
|
void |
update(RoleRecord existingRole,
RoleRecord updatedRole)
Update a role, given that the role token is unique.
|
init, shutdown, start, stopequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPersistedSnapshot, validatepublic void clear()
RoleRepositoryclear in interface RoleRepositorypublic RoleRecord getRoleByName(String roleName)
getRoleByName in interface RoleRepositorypublic Set<String> getRoleNamesByUsername(String username)
getRoleNamesByUsername in interface RoleRepositorypublic void create(RoleRecord role) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
RoleRepositorycreate in interface RoleRepositoryrole - the new role objectorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the role name is not valid or the role name already existsIOExceptionpublic void setRoles(org.neo4j.server.security.auth.ListSnapshot<RoleRecord> rolesSnapshot) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException, IOException
RoleRepositorysetRoles in interface RoleRepositoryrolesSnapshot - the new rolesorg.neo4j.kernel.api.exceptions.InvalidArgumentsException - if any role name is not validIOException - if the underlying storage for roles failspublic void update(RoleRecord existingRole, RoleRecord updatedRole) throws org.neo4j.server.security.auth.exception.ConcurrentModificationException, IOException
RoleRepositoryupdate in interface RoleRepositoryexistingRole - the existing role object, which must match the current state in this repositoryupdatedRole - the updated role objectorg.neo4j.server.security.auth.exception.ConcurrentModificationException - if the existingRole does not match the current state in the repositoryIOExceptionpublic boolean delete(RoleRecord role) throws IOException
RoleRepositorydelete in interface RoleRepositoryrole - the role to deleteIOExceptionpublic int numberOfRoles()
numberOfRoles in interface RoleRepositorypublic void assertValidRoleName(String name) throws org.neo4j.kernel.api.exceptions.InvalidArgumentsException
RoleRepositoryassertValidRoleName in interface RoleRepositoryname - the role name to be tested.org.neo4j.kernel.api.exceptions.InvalidArgumentsException - if the role name was invalid.public void removeUserFromAllRoles(String username) throws org.neo4j.server.security.auth.exception.ConcurrentModificationException, IOException
removeUserFromAllRoles in interface RoleRepositoryorg.neo4j.server.security.auth.exception.ConcurrentModificationExceptionIOExceptionpublic Set<String> getAllRoleNames()
getAllRoleNames in interface RoleRepositoryCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.