wt.clients.project
Class CRoleHolder

java.lang.Object
  extended bywt.clients.util.PersistableItem
      extended bywt.clients.project.CRoleHolder
Direct Known Subclasses:
CIndirectRoleHolder, CProject

public abstract class CRoleHolder
extends PersistableItem

A client wrapper class to handle a RoleHolder.


Field Summary
protected  RoleHolder roleHolder
          The real role holder object for this client role holder.
 
Fields inherited from class wt.clients.util.PersistableItem
 
Constructor Summary
CRoleHolder()
          Creates a new client role holder.
CRoleHolder(RoleHolder role_holder)
          Creates a new client role holder given a role holder.
 
Method Summary
 void addPrincipal(String role, String principal)
          Adds a principal to a role.
 boolean containsRole(String role)
          Returns true if the specified role is contained in this role holder, else returns false.
 void deletePrincipal(String role, String principal)
          Deletes a principal from a role.
 void deleteRole(String role)
          Deletes the role from the role holder.
 Enumeration getPrincipals(String role)
          Returns an enumeration of principal names given a role.
 RoleHolder getRoleHolder()
          Returns the role holder.
 Vector getRoleList()
          Returns a Vector of role names (Strings) in this role holder.
 Enumeration getRoles()
          Returns an enumeration of Role names.
 
Methods inherited from class wt.clients.util.PersistableItem
isCreated, isModified, refresh, save, setCreated, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roleHolder

protected RoleHolder roleHolder
The real role holder object for this client role holder.

Constructor Detail

CRoleHolder

public CRoleHolder()
Creates a new client role holder.


CRoleHolder

public CRoleHolder(RoleHolder role_holder)
Creates a new client role holder given a role holder.

Parameters:
role_holder - the role holder to base the client role holder on
Method Detail

getRoleHolder

public RoleHolder getRoleHolder()
Returns the role holder.


addPrincipal

public void addPrincipal(String role,
                         String principal)
                  throws WTException
Adds a principal to a role.

Parameters:
role - the role to add the principal to
principal - the principal to add to the role
Throws:
WTException - if the principal cannot be added

getPrincipals

public Enumeration getPrincipals(String role)
Returns an enumeration of principal names given a role.

Parameters:
role - the role to find the principals of

deletePrincipal

public void deletePrincipal(String role,
                            String principal)
                     throws WTException
Deletes a principal from a role.

Parameters:
role - the role to delete the principal from
principal - the principal to delete
Throws:
WTException - if the principal cannot be deleted

deleteRole

public void deleteRole(String role)
                throws WTException
Deletes the role from the role holder.

Parameters:
role - the role to delete
Throws:
WTException - if the role cannot be deleted

getRoles

public Enumeration getRoles()
                     throws WTException
Returns an enumeration of Role names.

Throws:
WTException - if the roles cannot be returned

containsRole

public boolean containsRole(String role)
                     throws WTException
Returns true if the specified role is contained in this role holder, else returns false.

Throws:
WTException - if it cannot be determined if the roles is in this role holder

getRoleList

public Vector getRoleList()
                   throws WTException
Returns a Vector of role names (Strings) in this role holder.

Throws:
WTException - if the list cannot be returned