@Service(value=UserManager.class) public class UserManagerImpl extends Object implements UserManager
Constructor and Description |
---|
UserManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
assignPermissionsToRole(String title,
List<String> permissionEntries)
Assigns a permission to a role
|
void |
assignPermissionsToUser(String name,
List<String> permissionEntries) |
void |
deleteAllPermissionsOfRole(String title)
Deletes all permission of a role
|
void |
deleteAllPermissionsOfUser(String name)
Deletes all permission of a user
|
void |
deletePermissionsOfRole(String title,
List<String> permissionEntries)
Deletes the defined permissions of the role
|
void |
deletePermissionsOfUser(String name,
List<String> permissionEntries) |
void |
deleteRole(String title) |
void |
deleteUser(String name) |
boolean |
emailExists(String email)
Checks if thereis already an agent with that email address.
|
String |
getNameByEmail(String email) |
Iterator<NonLiteral> |
getPermissionsOfRole(NonLiteral role) |
Iterator<NonLiteral> |
getPermissionsOfUser(NonLiteral user) |
NonLiteral |
getRoleByTitle(String title) |
Iterator<NonLiteral> |
getRoles() |
Iterator<NonLiteral> |
getRolesOfUser(NonLiteral user) |
NonLiteral |
getUserByName(String name) |
GraphNode |
getUserGraphNode(String name)
Returns the user with the specified name in an (editable) MGraph
(i.e.
|
GraphNode |
getUserInContentGraph(String name)
Returns the
GraphNode pointing to the user with the
specified name in the content graph. |
GraphNode |
getUserInSystemGraph(String name)
Returns the
GraphNode pointing to the user with the
specified name in the system graph. |
Iterator<NonLiteral> |
getUsers()
Returns all users.
|
boolean |
nameExists(String name)
Checks if the username exists
|
boolean |
roleExists(String title)
Checks if a role with this title exists
|
void |
storeRole(String title) |
void |
storeUser(String name,
String email,
String password,
List<String> assignedRoles,
String pathPrefix) |
void |
updateUser(String name,
String email,
String password,
Collection<String> assignedRoles,
String pathPrefix)
Updates the user with the specified userName
|
public void storeRole(String title)
storeRole
in interface UserManager
title
- the title of the role, may not be nullpublic NonLiteral getRoleByTitle(String title)
getRoleByTitle
in interface UserManager
public boolean roleExists(String title)
UserManager
roleExists
in interface UserManager
title
- specifies the title of the rolepublic Iterator<NonLiteral> getRoles()
getRoles
in interface UserManager
public Iterator<NonLiteral> getRolesOfUser(NonLiteral user)
getRolesOfUser
in interface UserManager
user
- the user is either a BNode or a UriRefpublic void deleteRole(String title)
deleteRole
in interface UserManager
title
- the title of the role to be deleted, may not be nullpublic void assignPermissionsToRole(String title, List<String> permissionEntries)
UserManager
assignPermissionsToRole
in interface UserManager
title
- specifies the title of the role, may not be nullpermissionEntries
- specifies a list of permissionspublic Iterator<NonLiteral> getPermissionsOfRole(NonLiteral role)
getPermissionsOfRole
in interface UserManager
role
- the role is either a BNode or an UriRefpublic void deletePermissionsOfRole(String title, List<String> permissionEntries)
UserManager
deletePermissionsOfRole
in interface UserManager
title
- specifies the title of the role, may not be nullpublic void deleteAllPermissionsOfRole(String title)
UserManager
deleteAllPermissionsOfRole
in interface UserManager
title
- specifies the title of the role, may not be nullpublic void storeUser(String name, String email, String password, List<String> assignedRoles, String pathPrefix)
storeUser
in interface UserManager
name
- the username of the user, may not be nullpublic String getNameByEmail(String email) throws UserHasNoNameException
getNameByEmail
in interface UserManager
graph
- email
- UserHasNoNameException
public void updateUser(String name, String email, String password, Collection<String> assignedRoles, String pathPrefix)
UserManager
updateUser
in interface UserManager
email
- the email address (note that this is not the mailto-uri)public boolean nameExists(String name)
UserManager
nameExists
in interface UserManager
name
- specifies the username, may not be nullpublic boolean emailExists(String email)
UserManager
emailExists
in interface UserManager
public NonLiteral getUserByName(String name)
getUserByName
in interface UserManager
name
- specifies the username of the userpublic Iterator<NonLiteral> getUsers()
UserManager
getUsers
in interface UserManager
public void deleteUser(String name)
deleteUser
in interface UserManager
name
- specifies the username of the user, may not be nullpublic void assignPermissionsToUser(String name, List<String> permissionEntries)
assignPermissionsToUser
in interface UserManager
name
- specifies the username of the user, may not be nullpublic Iterator<NonLiteral> getPermissionsOfUser(NonLiteral user)
getPermissionsOfUser
in interface UserManager
user
- the user is either a BNode or a UriRefpublic void deletePermissionsOfUser(String name, List<String> permissionEntries)
deletePermissionsOfUser
in interface UserManager
name
- specifies the username of the user, may not be nullpublic void deleteAllPermissionsOfUser(String name)
UserManager
deleteAllPermissionsOfUser
in interface UserManager
name
- specifies the username of the user, may not be nullpublic GraphNode getUserInSystemGraph(String name)
UserManager
GraphNode
pointing to the user with the
specified name in the system graph. Returns null if the user does not
exist.getUserInSystemGraph
in interface UserManager
name
- The username of the userpublic GraphNode getUserInContentGraph(String name)
UserManager
GraphNode
pointing to the user with the
specified name in the content graph. If the user does not exist in the
content graph, but in the system graph, then the it is created with the
PLATFORM.userName property copied from the system graph. Returns null if
the user does not exist.getUserInContentGraph
in interface UserManager
name
- The username of the userpublic GraphNode getUserGraphNode(String name)
UserManager
getUserGraphNode
in interface UserManager
name
- The username of the userCopyright © 2014 The Apache Software Foundation. All Rights Reserved.