|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.database.DBRole
A class representing the roles in a VO. Essentially, a database wrapper class for the roles table.
Field Summary | |
private long |
acl
The id of this role's ACL. |
private static ContainerNamingScheme |
cns
The container naming scheme for this instance of VOMS. |
private long |
createdBy
The id of the client who created this role. |
private long |
createdSerial
The number of the transaction that committed this role. |
private long |
id
The id of this role. |
private static int |
ID
|
private static org.apache.log4j.Logger |
log
Logger. |
private java.lang.String |
name
The name of this role, in display form. |
private static int |
NAME
|
(package private) static Sequence |
seq
Sequence. |
Constructor Summary | |
private |
DBRole(long id)
Initialize a new DBRole from the given id. |
private |
DBRole(java.lang.String name)
Initialize a new DBRole from the given name. |
Method Summary | |
void |
addMember(DBUser user)
Adds this role to user in the VO group. |
void |
addMember(DBUser user,
DBGroup group)
Adds this role to the given user in the given group. |
void |
checkPermission(Operation o)
Convenience method: check that the client has the necessary privileges to perform the given operation on this role. |
int |
countMembers()
Returns the number of users who have this role, in any group. |
int |
countMembers(DBGroup group)
Returns the number of users who have this role in the given group. |
static int |
countRoles()
|
static DBRole |
createRole(java.lang.String name)
Creates a new role. |
void |
deleteRole()
Delete this role. |
DBACL |
getACL()
Return this role's ACL. |
(package private) long |
getACLId()
Return the ACL id of this role. |
DBAdmin |
getCreatedBy()
Return the user who created this role. |
(package private) long |
getCreatedByid()
Return the id of the user who created this role. |
long |
getCreatedSerial()
Return the serial number of the transaction that committed this role. |
java.lang.String |
getDN()
Return the name of this role. |
(package private) long |
getId()
Return the id of this role. |
(package private) static DBRole |
getInstance(long id)
Returns a DBRole object representing the role with the given id. |
static DBRole |
getInstance(java.lang.String name)
Returns a DBRole object representing the named role. |
DBUser[] |
getMembers()
Return all users that have this role in any of the groups. |
DBUser[] |
getMembers(DBGroup group)
Return all users that have this role in the given group. |
User[] |
getMembersAsUser()
Return all users that have this role in any of the groups. |
User[] |
getMembersAsUser(DBGroup group)
Return all users that have this role in the given group. |
static java.lang.String[] |
getRoleNames()
Get the names of all roles that are associated with this group. |
private void |
initialize(int from)
Retrieve the given role from the database. |
boolean |
isMember(DBUser user)
Returns true if the given user has this role in any group. |
boolean |
isMember(DBUser user,
DBGroup group)
Returns true if the given user has this role in the given group. |
void |
removeAllMembers()
Rids this role from every user in all groups. |
void |
removeAllMembers(DBGroup group)
Rids this role from every user in the given group. |
void |
removeMember(DBUser user)
Rids the given user from this role in every group. |
void |
removeMember(DBUser user,
DBGroup group)
Removes this role from the given user associated with the given group. |
java.lang.String |
toString()
Convert to a human-readable string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final org.apache.log4j.Logger log
private java.lang.String name
private long id
private long acl
private long createdBy
private long createdSerial
static final Sequence seq
private static ContainerNamingScheme cns
private static final int NAME
private static final int ID
Constructor Detail |
private DBRole(java.lang.String name) throws GeneralDatabaseException, NotInDatabase, ArgumentException
private DBRole(long id) throws GeneralDatabaseException, NotInDatabase
Method Detail |
private void initialize(int from) throws GeneralDatabaseException, NotInDatabase, ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException
public static DBRole getInstance(java.lang.String name) throws GeneralDatabaseException, NotInDatabase, ArgumentException
name
- The name of the role.
NotInDatabase
- If there is no such group in the database.
GeneralDatabaseException
ArgumentException
static DBRole getInstance(long id) throws GeneralDatabaseException, NotInDatabase
id
- The id of the role.
NotInDatabase
- If there is no such group in the database.
GeneralDatabaseException
long getId()
public java.lang.String getDN()
getDN
in interface DBContainer
public java.lang.String toString()
toString
in interface DBContainer
toString
in class java.lang.Object
long getACLId()
getACL()
instead of this method.
long getCreatedByid()
getCreatedBy()
instead of this method.
public long getCreatedSerial()
public DBACL getACL() throws DatabaseError, InconsistentDatabase
getACL
in interface DBContainer
DatabaseError
InconsistentDatabase
public DBAdmin getCreatedBy() throws GeneralDatabaseException, NotInDatabase
NotInDatabase
- if the administrator has been deleted from the database.
GeneralDatabaseException
public void checkPermission(Operation o) throws GeneralDatabaseException, VOMSSecurityException
checkPermission
in interface DBContainer
GeneralDatabaseException
VOMSSecurityException
public void deleteRole() throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public int countMembers() throws GeneralDatabaseException
GeneralDatabaseException
public int countMembers(DBGroup group) throws GeneralDatabaseException
GeneralDatabaseException
public boolean isMember(DBUser user) throws GeneralDatabaseException
GeneralDatabaseException
public boolean isMember(DBUser user, DBGroup group) throws GeneralDatabaseException
GeneralDatabaseException
public DBUser[] getMembers() throws GeneralDatabaseException
GeneralDatabaseException
public User[] getMembersAsUser() throws GeneralDatabaseException
GeneralDatabaseException
public DBUser[] getMembers(DBGroup group) throws GeneralDatabaseException
GeneralDatabaseException
public User[] getMembersAsUser(DBGroup group) throws GeneralDatabaseException
GeneralDatabaseException
public void addMember(DBUser user) throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public void addMember(DBUser user, DBGroup group) throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public void removeMember(DBUser user) throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public void removeMember(DBUser user, DBGroup group) throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public void removeAllMembers() throws GeneralDatabaseException
GeneralDatabaseException
public void removeAllMembers(DBGroup group) throws GeneralDatabaseException
GeneralDatabaseException
public static DBRole createRole(java.lang.String name) throws GeneralDatabaseException, ArgumentException
name
- The name of the new role.
DBRole
object corresponding to the newly created role.
ArgumentException
- if the role is already in the database.
GeneralDatabaseException
public static java.lang.String[] getRoleNames() throws GeneralDatabaseException
GeneralDatabaseException
public static int countRoles() throws GeneralDatabaseException
GeneralDatabaseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |