com.waveset.object
Class Role

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.Service
          extended bycom.waveset.object.Role
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, XmlObject

public class Role
extends Service
implements java.lang.Comparable

An object defining a collection of services (resources, applications, and other roles) to be assgned to a user.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String ATT_OPAQUE
           
static java.lang.String ATT_ORDERED
           
static java.lang.String code_id
           
static java.lang.String EL_AUTHENTICATOR
           
static java.lang.String EL_RESOURCES
           
static java.lang.String EL_ROLEATTRIBUTES
           
static java.lang.String EL_ROLEEXCLUSIONREFS
           
static java.lang.String EL_SERVICES
           
static java.lang.String EL_SUPERROLES
           
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Role()
          Create an empty role, ready to be filled.
Role(org.w3c.dom.Element e)
          Create a role by parsing its DOM representation.
 
Method Summary
 void addApprover(ObjectRef ref)
          Add one approver to our approver list.
 void addApprover(WSUser admin)
          Add one approver to our approver list.
 void addResource(ObjectRef r)
          Adds a resource to the application.
 void addResource(Resource r)
          Add a new resource to the application.
 void addRoleAttribute(RoleAttribute ra)
           
 void addRoleExclusionRef(ObjectRef or)
           
 void addService(ObjectRef r)
          Adds a service reference to the application.
 void addService(Service s)
          Add one service to the list.
protected  void addSubclassAttributes(java.lang.StringBuffer b)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
protected  void addSubclassElements(java.lang.StringBuffer b)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
 void addSuperRole(ObjectRef r)
           
 void addSuperRole(Role s)
           
 void clearApprovers()
          Clear the approvers list.
 void clearResources()
          Removes all resources from the application.
 void clearRoleAttributes()
           
 void clearRoleExclusionRefs()
           
 void clearServices()
          Clear the services list.
 void clearSuperRoles()
           
 WSUser getAdministrator()
          Get the approval administrator for this role.
 java.util.List getApplicationRefs()
          Gets the list of applications references in this application.
 Application[] getApplications()
          Return the current list of applications assigned to this role/
 java.util.List getApproverRefs()
          Get the list of references to approvers for this role.
 WSUser[] getApprovers()
          Get an array of resolved approver objects for this role.
 java.util.List getAssignedApplicationRefs()
          return Application refs directly assigned to this role
 java.util.List getAssignedRefs(Type type)
          Gets the list of resource references directly assigned to this role
 java.util.List getAssignedResourceRefs()
          return Resource refs directly assigned to this role
 java.util.List getAssignedRoleRefs()
          return Role refs directly assigned to this role
 java.util.List getAssignmentRefs()
          return possibly qualified Resource refs directly assigned to this role
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 ObjectRef getAuthenticatorRef()
           
 java.util.List getNotificationRefs()
          Get the list of references to notification listeners for this role.
 WSUser[] getNotifications()
           
 GenericObject getPolicyUpgradeMap()
          Create a map of the attributes and elements that make up what has moved to the LighthouseAccountPolicy - specifically: Attributes: idSource String passwordSource String questionPolicy String randomQuestionCount int roundRobinQuestionIndex int accountLock boolean resetOption String resetCheck String Elements: PasswordExpiry Util.TimePeriod PasswordExpiryWarning Util.TimePeriod TempPasswordExpiry Util.TimePeriod AuthenticationQuestions List of GenericObject, attributes id & question ResetLimit int resetLimitPeriod resetLimitPeriod
 java.util.ArrayList getReferences()
          Return the list of references within this object.
 java.util.Set getResourceAssignmentRefs()
          Gets the list of possibly qualified resource references in this application.
 java.util.Set getResourceAssignments()
          Return the set of ResourceAssignments encapsulated by this Service and any Services it contains.
 java.util.List getResourceRefs()
          Gets the list of resource references in this application.
 Resource[] getResources()
          Calculate a flattened list of resource objects referenced by this role.
 java.util.List getRoleAttributes()
           
 java.util.List getRoleExclusionRefs()
           
 java.util.List getRoleRefs()
          Gets the list of applications references in this application.
 Role[] getRoles()
          Return array of current roles assigned to this role
 java.util.List getServiceRefs()
          Get the list of references to services.
 Service[] getServices()
          Resolve the list of service references, and return an array of service objects.
 java.util.List getSubRoleIdList()
          Return the current list of roles assigned to this role
 java.util.List getSubRoleList()
          Return the current list of roles assigned to this role
 java.util.List getSubRoleNameList()
          Return the current list of roles assigned to this role
 WSAttributes getSummaryAttributes()
           
 java.util.List getSuperRoleIdList()
          Return the current list of roles that assign this role
 java.util.List getSuperRoleList()
           
 java.util.List getSuperRoleRefs()
           
 Role[] getSuperRoles()
           
 Type getType()
          Returns the associated Type object.
 boolean isOpaque()
          Test the opaque flag.
 boolean isOrdered()
          Override this if this service is a container and order is important.
 java.util.List listQueryableAttributes()
           
 java.util.List listQueryableReferenceAttributes()
           
 java.util.List listSummaryAttributes()
          Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).
protected  void parseSubclassAttributes(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).
protected  void parseSubclassElements(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).
 void removeApprover(ObjectRef ref)
          Remove one approver from our approver list.
 void removeApprover(WSUser admin)
          Remove one approver from our approver list.
 void removeResource(ObjectRef ref)
          Removes a resource reference.
 void removeResource(Resource r)
          Removes a resource reference.
 void removeService(ObjectRef ref)
          Removes a service.
 void removeService(Service s)
          Removes a service reference.
 void removeSuperRole(ObjectRef ref)
           
 void removeSuperRole(Role s)
           
static void resolveSummaryAttributes(ObjectCache cache, WSAttributes attrs)
          Walk the summary attributes, translating the embedded IDs to names.
 void setAdministrator(WSUser a)
          Set the approval administrator for this role.
 void setApprovers(java.util.List approvers)
           
 void setAuthenticator(ObjectRef ref)
           
 void setNotificationRefs(java.util.List refs)
           
 void setOpaque(boolean b)
           
 void setOrdered(boolean b)
           
 void setRoleAttributes(java.util.List list)
           
 void setRoleExclusionRefs(java.util.List list)
           
 void setServices(Service[] sarray)
          Set the services list in one operation by specifying an array of service objects.
 void setSuperRoles(Service[] sarray)
           
 void visit(Visitor v)
          Visitor interface.
 
Methods inherited from class com.waveset.object.Service
checkForReferenceCycles, dumpSummary, findApplications, findApplications, findResourceAssignments, findResources, findRoleAttributes, findRoleExclusions, findRoles, findRoles, findServices, findServices, getFlatResourceAssignments, getFlatResourceAssignments, getFlatResources, getFlatResources, getFlatResources, getFlatResources, toIdentityString, toVerboseString, toVerboseString
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getDisplayName, getElementName, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

EL_SERVICES

public static final java.lang.String EL_SERVICES
See Also:
Constant Field Values

EL_SUPERROLES

public static final java.lang.String EL_SUPERROLES
See Also:
Constant Field Values

EL_RESOURCES

public static final java.lang.String EL_RESOURCES
See Also:
Constant Field Values

EL_AUTHENTICATOR

public static final java.lang.String EL_AUTHENTICATOR
See Also:
Constant Field Values

EL_ROLEATTRIBUTES

public static final java.lang.String EL_ROLEATTRIBUTES
See Also:
Constant Field Values

EL_ROLEEXCLUSIONREFS

public static final java.lang.String EL_ROLEEXCLUSIONREFS
See Also:
Constant Field Values

ATT_OPAQUE

public static final java.lang.String ATT_OPAQUE
See Also:
Constant Field Values

ATT_ORDERED

public static final java.lang.String ATT_ORDERED
See Also:
Constant Field Values
Constructor Detail

Role

public Role()
Create an empty role, ready to be filled.


Role

public Role(org.w3c.dom.Element e)
     throws WavesetException
Create a role by parsing its DOM representation.

Method Detail

visit

public void visit(Visitor v)
           throws WavesetException
Visitor interface.

Overrides:
visit in class PersistentObject
Throws:
WavesetException

getType

public Type getType()
Returns the associated Type object.

Specified by:
getType in class PersistentObject

getReferences

public java.util.ArrayList getReferences()
Return the list of references within this object.

Overrides:
getReferences in class PersistentObject

isOrdered

public boolean isOrdered()
Description copied from class: Service
Override this if this service is a container and order is important.

Overrides:
isOrdered in class Service

setOrdered

public void setOrdered(boolean b)

getApproverRefs

public java.util.List getApproverRefs()
Get the list of references to approvers for this role.


getApprovers

public WSUser[] getApprovers()
                      throws WavesetException
Get an array of resolved approver objects for this role.

Throws:
WavesetException

getNotificationRefs

public java.util.List getNotificationRefs()
Get the list of references to notification listeners for this role.


setNotificationRefs

public void setNotificationRefs(java.util.List refs)

getNotifications

public WSUser[] getNotifications()
                          throws WavesetException
Throws:
WavesetException

clearApprovers

public void clearApprovers()
Clear the approvers list.


addApprover

public void addApprover(ObjectRef ref)
Add one approver to our approver list.

These should be administrators with APPROVAL rights. Can't check that here, it will have to be done as part of the Checkin validator. The GUI currently tries to prevent selection of bad values.


addApprover

public void addApprover(WSUser admin)
Add one approver to our approver list.

These should be administrators with APPROVAL rights. Can't check that here, it will have to be done as part of the Checkin validator. The GUI currently tries to prevent selection of bad values.

If you want to specify a completely new list, call clearApprovers first.

See Also:
clearApprovers()

removeApprover

public void removeApprover(ObjectRef ref)
Remove one approver from our approver list.


removeApprover

public void removeApprover(WSUser admin)
Remove one approver from our approver list.


setApprovers

public void setApprovers(java.util.List approvers)

getServiceRefs

public java.util.List getServiceRefs()
Get the list of references to services.

Specified by:
getServiceRefs in class Service

getSuperRoleRefs

public java.util.List getSuperRoleRefs()

getServices

public Service[] getServices()
                      throws WavesetException
Resolve the list of service references, and return an array of service objects.

Formerly the array was cached for subsequent calls, but that was fragile, and I don't think was all that necessary.

Specified by:
getServices in class Service
Throws:
WavesetException

getSuperRoles

public Role[] getSuperRoles()
                     throws WavesetException
Throws:
WavesetException

getSuperRoleList

public java.util.List getSuperRoleList()
                                throws WavesetException
Throws:
WavesetException

addService

public void addService(ObjectRef r)
Adds a service reference to the application.


removeService

public void removeService(Service s)
Removes a service reference.

The reference is specified as a Service object.


addSuperRole

public void addSuperRole(ObjectRef r)

removeSuperRole

public void removeSuperRole(Role s)

getResources

public Resource[] getResources()
                        throws WavesetException
Calculate a flattened list of resource objects referenced by this role.

We formerly tried to cache this, but its fragile. Now the array is calculated every time.

Specified by:
getResources in class Service
Throws:
WavesetException

getResourceAssignments

public java.util.Set getResourceAssignments()
                                     throws WavesetException
Description copied from class: Service
Return the set of ResourceAssignments encapsulated by this Service and any Services it contains.

Specified by:
getResourceAssignments in class Service
Throws:
WavesetException

getApplications

public Application[] getApplications()
                              throws WavesetException
Return the current list of applications assigned to this role/

Throws:
WavesetException

getRoles

public Role[] getRoles()
                throws WavesetException
Return array of current roles assigned to this role

Throws:
WavesetException

getSubRoleList

public java.util.List getSubRoleList()
                              throws WavesetException
Return the current list of roles assigned to this role

Throws:
WavesetException

getSubRoleNameList

public java.util.List getSubRoleNameList()
                                  throws WavesetException
Return the current list of roles assigned to this role

Throws:
WavesetException

getSubRoleIdList

public java.util.List getSubRoleIdList()
                                throws WavesetException
Return the current list of roles assigned to this role

Throws:
WavesetException

getSuperRoleIdList

public java.util.List getSuperRoleIdList()
                                  throws WavesetException
Return the current list of roles that assign this role

Throws:
WavesetException

clearServices

public void clearServices()
Clear the services list.


clearSuperRoles

public void clearSuperRoles()

setServices

public void setServices(Service[] sarray)
Set the services list in one operation by specifying an array of service objects. Applications ordinarilly use addService instead.


setSuperRoles

public void setSuperRoles(Service[] sarray)

addService

public void addService(Service s)
Add one service to the list.


addSuperRole

public void addSuperRole(Role s)

removeService

public void removeService(ObjectRef ref)
Removes a service.


removeSuperRole

public void removeSuperRole(ObjectRef ref)

getResourceRefs

public java.util.List getResourceRefs()
                               throws WavesetException
Gets the list of resource references in this application. Now that we can contain other Services as well as resources, we have to calcuate this.

Specified by:
getResourceRefs in class Service
Throws:
WavesetException

getResourceAssignmentRefs

public java.util.Set getResourceAssignmentRefs()
                                        throws WavesetException
Gets the list of possibly qualified resource references in this application. Now that we can contain other Services as well as resources, we have to calcuate this.

Specified by:
getResourceAssignmentRefs in class Service
Throws:
WavesetException

getAssignedRefs

public java.util.List getAssignedRefs(Type type)
Gets the list of resource references directly assigned to this role


getAssignedRoleRefs

public java.util.List getAssignedRoleRefs()
return Role refs directly assigned to this role


getAssignedApplicationRefs

public java.util.List getAssignedApplicationRefs()
return Application refs directly assigned to this role


getAssignedResourceRefs

public java.util.List getAssignedResourceRefs()
return Resource refs directly assigned to this role


getAssignmentRefs

public java.util.List getAssignmentRefs()
return possibly qualified Resource refs directly assigned to this role


getApplicationRefs

public java.util.List getApplicationRefs()
                                  throws WavesetException
Gets the list of applications references in this application.

Throws:
WavesetException

getRoleRefs

public java.util.List getRoleRefs()
                           throws WavesetException
Gets the list of applications references in this application.

Throws:
WavesetException

listSummaryAttributes

public java.util.List listSummaryAttributes()
Description copied from class: PersistentObject
Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.

Overrides:
listSummaryAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:
Constants.MAX_SUMMARY_STRING_LENGTH, PersistentObject.getSummaryString()

resolveSummaryAttributes

public static void resolveSummaryAttributes(ObjectCache cache,
                                            WSAttributes attrs)
                                     throws WavesetException
Description copied from class: PersistentObject
Walk the summary attributes, translating the embedded IDs to names. For this object, they are just name and ID which do not need translating.

Throws:
WavesetException

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listQueryableAttributes() to ensure that the subclass includes queryable attributes that are common to all PersistentObjects.


listQueryableReferenceAttributes

public java.util.List listQueryableReferenceAttributes()
Overrides:
listQueryableReferenceAttributes in class PersistentObject
Returns:
the list of defined attributes that this type of persistent object exposes as queryable and for which each value is a reference to another persistent object.

getSummaryAttributes

public WSAttributes getSummaryAttributes()
Overrides:
getSummaryAttributes in class PersistentObject
Returns:
attribute values to be displayed when this object appears in a list. The WSAttributes contains a WSAttribute for each summary attribute. Each WSAttribute may contain multiple values.

Any subclass of PersistentObject that overrides this method should first invoke super.getSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:

If a subclass wants to expose a different set of summary attributes, that subclass should override {@link #listSummaryAttributes}. In order to supply values for summary attributes that may not be available in PersistentObject (e.g., from a field specified to that subclass), such a subclass may also override {@link #getAttributeValues(Attribute)}.

A subclass should not need to override this method (except to limit the number of values for a summary attribute).


getAttributeValues

protected WSAttribute getAttributeValues(java.lang.String attrName)
Overrides:
getAttributeValues in class PersistentObject
Parameters:
attrName - - the name of the attribute for which to return values.
Returns:
a WSAttribute that represents the value (or values) that this object contains for the specified attribute.


getPolicyUpgradeMap

public GenericObject getPolicyUpgradeMap()
Create a map of the attributes and elements that make up what has moved to the LighthouseAccountPolicy - specifically: Attributes: idSource String passwordSource String questionPolicy String randomQuestionCount int roundRobinQuestionIndex int accountLock boolean resetOption String resetCheck String Elements: PasswordExpiry Util.TimePeriod PasswordExpiryWarning Util.TimePeriod TempPasswordExpiry Util.TimePeriod AuthenticationQuestions List of GenericObject, attributes id & question ResetLimit int resetLimitPeriod resetLimitPeriod


addSubclassAttributes

protected void addSubclassAttributes(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.

Overrides:
addSubclassAttributes in class PersistentObject
See Also:


addSubclassElements

protected void addSubclassElements(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.

Overrides:
addSubclassElements in class PersistentObject
See Also:


parseSubclassAttributes

protected void parseSubclassAttributes(org.w3c.dom.Element e)
                                throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassAttributes in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

parseSubclassElements

protected void parseSubclassElements(org.w3c.dom.Element e)
                              throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassElements in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

getAdministrator

public WSUser getAdministrator()
                        throws WavesetException
Get the approval administrator for this role.

Deprecated, you should be using getApprovers. If there are more than approvers, the first one is returned. #see #getApprovers

Throws:
WavesetException

setAdministrator

public void setAdministrator(WSUser a)
Set the approval administrator for this role.

Deprecated, you should be using addApprover. If there is currently more than one approver, the entire list will be cleared and set to this one.

See Also:
addApprover(com.waveset.object.ObjectRef)

addResource

public void addResource(Resource r)
Add a new resource to the application.


addResource

public void addResource(ObjectRef r)
Adds a resource to the application.


removeResource

public void removeResource(Resource r)
Removes a resource reference.


removeResource

public void removeResource(ObjectRef ref)
Removes a resource reference.


clearResources

public void clearResources()
Removes all resources from the application.


isOpaque

public boolean isOpaque()
Test the opaque flag.


setOpaque

public void setOpaque(boolean b)

getAuthenticatorRef

public ObjectRef getAuthenticatorRef()

setAuthenticator

public void setAuthenticator(ObjectRef ref)

getRoleAttributes

public java.util.List getRoleAttributes()
Returns:
a List of RoleAttribute objects

setRoleAttributes

public void setRoleAttributes(java.util.List list)

clearRoleAttributes

public void clearRoleAttributes()

addRoleAttribute

public void addRoleAttribute(RoleAttribute ra)

getRoleExclusionRefs

public java.util.List getRoleExclusionRefs()

setRoleExclusionRefs

public void setRoleExclusionRefs(java.util.List list)

clearRoleExclusionRefs

public void clearRoleExclusionRefs()

addRoleExclusionRef

public void addRoleExclusionRef(ObjectRef or)