org.glite.security.voms.database
Class DBQualifiedRole

java.lang.Object
  extended byorg.glite.security.voms.database.DBQualifiedRole
All Implemented Interfaces:
DBContainer

public final class DBQualifiedRole
extends java.lang.Object
implements DBContainer

A class representing qualified roles in the VO. A qualified role is a composition of a group and a role. Users are assigned roles in a given group. Essentially, a qualified role is a group-local projection of a role.

Author:
Karoly Lorentey

Method Summary
 void addMember(DBUser user)
          Adds this qualified role to the given user.
 void checkPermission(Operation o)
          Convenience method: check that the client has the necessary privileges to perform the given operation on this container.
 int countMembers()
          Returns the number of users who have this qualified role.
 DBACL getACL()
          Return the qualified role's ACL.
 java.lang.String getDN()
          Return the name of this qualified role.
 DBGroup getGroup()
           
static DBQualifiedRole getInstance(DBGroup group, DBRole role)
          Returns a DBQualifiedRole object representing the qualified role composed of the given components.
static DBQualifiedRole getInstance(java.lang.String name)
          Returns a DBQualifiedRole object representing the named qualified role.
 java.lang.String[] getMemberNames()
          Return all users that have this qualified role in the given group.
 DBUser[] getMembers()
          Return all users that have this qualified role.
 User[] getMembersAsUser()
          Return all users that have this qualified role in the given group.
 DBRole getRole()
           
 boolean isMember(DBUser user)
          Returns true if the given user has this qualified role.
 void removeAllMembers()
          Removes this qualified role from every user.
 void removeMember(DBUser user)
          Rids the given user from this qualified role.
 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
 

Method Detail

getInstance

public static DBQualifiedRole getInstance(java.lang.String name)
                                   throws GeneralDatabaseException,
                                          NotInDatabase,
                                          ArgumentException
Returns a DBQualifiedRole object representing the named qualified role.

Throws:
GeneralDatabaseException
NotInDatabase
ArgumentException

getInstance

public static DBQualifiedRole getInstance(DBGroup group,
                                          DBRole role)
Returns a DBQualifiedRole object representing the qualified role composed of the given components.


getDN

public java.lang.String getDN()
Return the name of this qualified role.

Specified by:
getDN in interface DBContainer

toString

public java.lang.String toString()
Convert to a human-readable string.

Specified by:
toString in interface DBContainer

getGroup

public DBGroup getGroup()

getRole

public DBRole getRole()

getACL

public DBACL getACL()
             throws GeneralDatabaseException
Return the qualified role's ACL. It is the same as getRole().getACL().

Specified by:
getACL in interface DBContainer
Throws:
GeneralDatabaseException

checkPermission

public void checkPermission(Operation o)
                     throws GeneralDatabaseException,
                            VOMSSecurityException
Convenience method: check that the client has the necessary privileges to perform the given operation on this container.

Specified by:
checkPermission in interface DBContainer
Throws:
GeneralDatabaseException
VOMSSecurityException

countMembers

public int countMembers()
                 throws GeneralDatabaseException
Returns the number of users who have this qualified role.

Throws:
GeneralDatabaseException

isMember

public boolean isMember(DBUser user)
                 throws GeneralDatabaseException
Returns true if the given user has this qualified role.

Throws:
GeneralDatabaseException

getMembers

public DBUser[] getMembers()
                    throws GeneralDatabaseException
Return all users that have this qualified role.

Specified by:
getMembers in interface DBContainer
Throws:
GeneralDatabaseException

getMembersAsUser

public User[] getMembersAsUser()
                        throws GeneralDatabaseException
Return all users that have this qualified role in the given group.

Specified by:
getMembersAsUser in interface DBContainer
Throws:
GeneralDatabaseException

getMemberNames

public java.lang.String[] getMemberNames()
                                  throws GeneralDatabaseException
Return all users that have this qualified role in the given group.

Specified by:
getMemberNames in interface DBContainer
Throws:
GeneralDatabaseException

addMember

public void addMember(DBUser user)
               throws GeneralDatabaseException,
                      ArgumentException
Adds this qualified role to the given user.

Specified by:
addMember in interface DBContainer
Throws:
GeneralDatabaseException
ArgumentException

removeMember

public void removeMember(DBUser user)
                  throws GeneralDatabaseException,
                         ArgumentException
Rids the given user from this qualified role.

Specified by:
removeMember in interface DBContainer
Throws:
GeneralDatabaseException
ArgumentException

removeAllMembers

public void removeAllMembers()
                      throws GeneralDatabaseException
Removes this qualified role from every user.

Throws:
GeneralDatabaseException