|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.database.DBGroup
A class representing the groups in a VO. Essentially, a wrapper class for the groups table.
Field Summary | |
private long |
aclId
The id of the group's access control list. |
private static ContainerNamingScheme |
cns
The container naming scheme for this instance of VOMS. |
private long |
createdBy
The id of the client who created this row. |
private long |
createdSerial
The number of the transaction that created this row. |
private long |
defaultACLId
The id of the group's default access control list. |
private long |
id
The id of this group. |
private static int |
ID
|
private static VOMSException |
initError
|
private static org.apache.log4j.Logger |
log
Logger. |
private boolean |
must
Whether this is a non-deniable group. |
private java.lang.String |
name
The fully qualified name of this group, in display form. |
private static int |
NAME
|
private long |
parent
The id of the group's parent group. |
(package private) static Sequence |
seq
Sequence. |
static long |
VO_GROUP_ID
The id of the VO group. |
private static DBGroup |
voGroup
The VO group. |
Constructor Summary | |
private |
DBGroup(long id)
Initialize a new DBGroup from the given id. |
private |
DBGroup(java.lang.String name)
Initialize a new DBGroup from the given name. |
Method Summary | |
void |
addMember(DBUser user)
Add a user to the members of this group. |
void |
checkPermission(Operation o)
Convenience method: check that the client has the necessary privileges to perform the given operation on this group. |
int |
countAllGroups()
Return the number of groups in this VO. |
int |
countChildGroups()
Return the number of direct subgroups of this group. |
int |
countMembers()
Returns the number of users who are members of this group. |
DBGroup |
createChildGroup(java.lang.String name)
Creates a new group with this group as parent. |
void |
deleteGroup()
Delete this group. |
DBACL |
getACL()
Return this group's ACL. |
(package private) long |
getACLId()
Return the ACL id of this group. |
java.util.List |
getAdminUsersForOperation(Operation o)
Convenience method: returns the list of users, who also play administrative role for the given operation. |
java.lang.String[] |
getChildGroupNames()
Get the names of direct subgroups of this group. |
DBGroup[] |
getChildGroups()
Get the direct subgroups of this group. |
DBAdmin |
getCreatedBy()
Return the administrator who created this group. |
(package private) long |
getCreatedById()
Return the id of the user who created this group. |
long |
getCreatedSerial()
Return the serial number of the transaction that committed this group. |
DBACL |
getDefaultACL()
Return this group's default ACL. |
(package private) long |
getDefaultACLId()
Return the default ACL id of this group. |
java.lang.String |
getDN()
Return the name of this group. |
(package private) long |
getId()
Return the id of this group. |
(package private) static DBGroup |
getInstance(long id)
Returns a DBGroup object representing the group with the given id. |
static DBGroup |
getInstance(java.lang.String name)
Returns a DBGroup object representing the named group. |
DBUser[] |
getMembers()
Return the members of this group as DBUser objects. |
User[] |
getMembersAsUser()
Return the names of all members of this group as User objects. |
boolean |
getMust()
Return true iff the group is non-deniable. |
DBGroup |
getParent()
Return this group's parent group. |
(package private) long |
getParentId()
Return the id of this group's parent group. |
static DBGroup |
getVOGroup()
Returns a DBGroup object representing the VO group. |
private void |
initialize(int from)
Query the database for the full group row. |
boolean |
isChildGroup(DBGroup child)
Return true if the given group is a direct subgroup of this group. |
boolean |
isMember(DBUser user)
Returns true if the given user is a member of this group. |
boolean |
isVOGroup()
Return true if this group is the VO group. |
void |
removeAllMembers()
Remove all members of this group. |
void |
removeMember(DBUser user)
Remove a user from this group. |
void |
setAttributes(boolean must)
Set auxiliary attributes. |
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
public static final long VO_GROUP_ID
private java.lang.String name
private long id
private long parent
private long aclId
private long defaultACLId
private boolean must
private long createdBy
private long createdSerial
static final Sequence seq
private static ContainerNamingScheme cns
private static DBGroup voGroup
private static VOMSException initError
private static final int NAME
private static final int ID
Constructor Detail |
private DBGroup(java.lang.String name) throws GeneralDatabaseException, NotInDatabase, ArgumentException
private DBGroup(long id) throws GeneralDatabaseException, NotInDatabase
Method Detail |
private void initialize(int from) throws GeneralDatabaseException, NotInDatabase, ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException
public static DBGroup getInstance(java.lang.String name) throws GeneralDatabaseException, NotInDatabase, ArgumentException
name
- The fully qualified name of the group. (Null is an alias for the VO group.)
NotInDatabase
- If there is no such group in the database.
GeneralDatabaseException
ArgumentException
static DBGroup getInstance(long id) throws GeneralDatabaseException, NotInDatabase
id
- The internal id of the group. A group with that id must be present in the database.
NotInDatabase
- If there is no such group in the database.
GeneralDatabaseException
public static DBGroup getVOGroup() throws GeneralDatabaseException
GeneralDatabaseException
long getId()
public java.lang.String getDN()
getDN
in interface DBContainer
public boolean getMust()
public java.lang.String toString()
toString
in interface DBContainer
toString
in class java.lang.Object
long getParentId()
getParent
instead of this method.
long getACLId()
getACL
instead of this method.
long getDefaultACLId()
getDefaultACl
instead of this method.
long getCreatedById()
getCreatedBy
instead of this
method.
public long getCreatedSerial()
public DBGroup getParent() throws GeneralDatabaseException
GeneralDatabaseException
public DBACL getACL() throws DatabaseError, InconsistentDatabase
getACL
in interface DBContainer
DatabaseError
InconsistentDatabase
public DBACL getDefaultACL() throws DatabaseError, InconsistentDatabase
DatabaseError
InconsistentDatabase
public DBAdmin getCreatedBy() throws GeneralDatabaseException, NotInDatabase
NotInDatabase
- if the administrator has been deleted from the database.
GeneralDatabaseException
public boolean isVOGroup()
public void checkPermission(Operation o) throws GeneralDatabaseException, VOMSSecurityException
checkPermission
in interface DBContainer
GeneralDatabaseException
VOMSSecurityException
public java.util.List getAdminUsersForOperation(Operation o) throws GeneralDatabaseException, VOMSSecurityException
GeneralDatabaseException
VOMSSecurityException
public int countAllGroups() throws GeneralDatabaseException
GeneralDatabaseException
public int countChildGroups() throws GeneralDatabaseException
GeneralDatabaseException
public boolean isChildGroup(DBGroup child) throws GeneralDatabaseException
child
- The group to check.
GeneralDatabaseException
public DBGroup[] getChildGroups() throws GeneralDatabaseException
GeneralDatabaseException
public java.lang.String[] getChildGroupNames() throws GeneralDatabaseException
GeneralDatabaseException
public DBGroup createChildGroup(java.lang.String name) throws GeneralDatabaseException, ArgumentException
The new groups gets a copy of the parent group's ACL and default ACL,
extended with an The group becomes a non-deniable group by default.
name
- The fqgn of the new group.
ArgumentException
- if a group with the given name already exists.
GeneralDatabaseException
public void deleteGroup() throws GeneralDatabaseException, ArgumentException
ArgumentException
- if the group has members or subcontainers or if the group is the VO group.
GeneralDatabaseException
public int countMembers() throws GeneralDatabaseException
GeneralDatabaseException
public boolean isMember(DBUser user) throws GeneralDatabaseException
user
- The user to check for.
GeneralDatabaseException
public DBUser[] getMembers() throws GeneralDatabaseException
DBUser
objects.
GeneralDatabaseException
public User[] getMembersAsUser() throws GeneralDatabaseException
User
objects.
GeneralDatabaseException
public void addMember(DBUser user) throws GeneralDatabaseException, ArgumentException
user
- The user to add.
ArgumentException
- if the user is already a member of this group.
GeneralDatabaseException
public void removeMember(DBUser user) throws GeneralDatabaseException, ArgumentException
user
- The user to remove.
ArgumentException
- if the user is not a member of the group.
GeneralDatabaseException
public void removeAllMembers() throws GeneralDatabaseException
GeneralDatabaseException
public void setAttributes(boolean must) throws InconsistentDatabase, DatabaseError
InconsistentDatabase
DatabaseError
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |