|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.server.repository.structures.Role
public class Role
Provides access to role data stored in the repository. Users have all the privileges of the roles they belong to. Unlike many of the data access objects in anzo, roles are not batched and changes are persisted to the database immediately.
| Constructor Summary | |
|---|---|
Role(java.lang.Long id,
RepositoryConnection repositoryConnection)
Builds a role object for the given id. |
|
| Method Summary | |
|---|---|
void |
addImplicitUser(User user,
java.lang.Long modified)
Add a user to this role |
static void |
addSubRole(RepositoryConnection repositoryConnection,
Role parentId,
Role childId,
java.lang.Long modified)
Add a child role to a parent role in the database |
boolean |
addUser(User user,
java.lang.Long modified)
Add a user to this role, and add any implied roles based on role hierarchy |
static Role |
createRole(java.lang.Long id,
java.lang.Long modified,
RepositoryConnection repositoryConnection)
Creates a new role. |
boolean |
equals(java.lang.Object obj)
|
static Role |
getEveryoneNode(RepositoryConnection repositoryConnection,
java.lang.Long modified)
Get the Role that covers every user |
java.lang.Long |
getId()
Unique id for role |
java.util.Set<Role> |
getParentRoles(java.util.Set<Role> roles)
Get the roles in the role's hierarchy |
org.openrdf.model.URI |
getURI()
URI for role |
int |
hashCode()
|
java.util.Iterator<User> |
listUsers()
Gets an Iterator for the users in the role. |
static Role |
loadRole(java.lang.Long id,
RepositoryConnection repositoryConnection)
Load a role from the database |
void |
remove(java.lang.Long modified)
Remove this Role and any subrole relationships from the database |
static void |
removeSubRole(RepositoryConnection repositoryConnection,
Role parent,
Role child,
java.lang.Long modified)
Remove a child role from a parent role in the database |
boolean |
removeUser(User user,
java.lang.Long modified)
Remove user from this role |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Role(java.lang.Long id,
RepositoryConnection repositoryConnection)
id - The id for the role.repositoryConnection - Repository connection to run queries against| Method Detail |
|---|
public static Role getEveryoneNode(RepositoryConnection repositoryConnection,
java.lang.Long modified)
throws AnzoException
repositoryConnection - Repository connection to run queries againstmodified - Timestamp when role should be created if it does not exist
AnzoException
public static Role loadRole(java.lang.Long id,
RepositoryConnection repositoryConnection)
id - The id for the role.repositoryConnection - Repository connection to run queries against
null if it is not stored
public static Role createRole(java.lang.Long id,
java.lang.Long modified,
RepositoryConnection repositoryConnection)
throws AnzoException
id - The id for the new role. This id must not already be in use. *modified - Timestamp when role should be created if it does not existrepositoryConnection - Repository connection to run queries against
AnzoException - Throws new AnzoException if role is already stored
public static void addSubRole(RepositoryConnection repositoryConnection,
Role parentId,
Role childId,
java.lang.Long modified)
throws AnzoException
repositoryConnection - Repository connection to run queries againstparentId - Parent rolechildId - Child rolemodified - Timestamp when role should be created if it does not exist
AnzoException - Throw an exception if database insert fails
public static void removeSubRole(RepositoryConnection repositoryConnection,
Role parent,
Role child,
java.lang.Long modified)
throws AnzoException
repositoryConnection - Repository connection to run queries againstparent - Parent rolechild - Child rolemodified - Timestamp when role should be removed
AnzoException - Throw an exception if database remove fails
public java.util.Set<Role> getParentRoles(java.util.Set<Role> roles)
throws AnzoException
roles - Set of already visited roles
AnzoException
public java.util.Iterator<User> listUsers()
throws AnzoException
AnzoException
public void addImplicitUser(User user,
java.lang.Long modified)
throws AnzoException
user - User to add to rolemodified - Timestamp when user is added to role
AnzoException
public boolean addUser(User user,
java.lang.Long modified)
throws AnzoException
user - User to add to rolemodified - Timestamp when user is added to role
AnzoException
public boolean removeUser(User user,
java.lang.Long modified)
throws AnzoException
user - User to remove from this rolemodified - Timestamp when user was removed from role
AnzoExceptionpublic java.lang.Long getId()
public org.openrdf.model.URI getURI()
public void remove(java.lang.Long modified)
throws AnzoException
modified - Timestamp when role was removed from database
AnzoExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||