com.waveset.object
Class Policy

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

public class Policy
extends PersistentObject

A class used to represent policies. Currently, these are used only as string validation rules that may be associated with fields in other objects.

These are structurally similar to Resource objects, in that they are backed by a PolicyImplementation object which is a pluggable class that implements a policy. The Policy object encapsulates paramters to the policy implementation.

See Also:
PolicyImplementation, PolicyManager

Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String ALL_INTERFACES
           
static java.lang.String code_id
           
static java.lang.String MIN_NUMERIC
          Attribute constants for a temporary upgrade.
static java.lang.String MIN_SPECIAL
           
static java.lang.String MUST_NOT_CONTAIN
           
static java.lang.String MUST_NOT_CONTAIN_WORDS
           
static java.lang.String PASSWORD_HISTORY_DEPTH
          A policy attribute that specifies the number of previous passwords that should be kept per user, per resource.
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Policy()
          Create an empty policy ready for filling.
Policy(org.w3c.dom.Element e)
          Flesh out policy object by parsing its XML representation.
 
Method Summary
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).
 Message getAssignmentMessage()
          Return the description of this policy.
 GenericObject getAttributes()
          Get the list of policy attributes.
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 java.lang.String getDescription()
          Return the description of this policy.
 java.lang.String getImplementation()
          Get the name of the policy implementation class.
 java.lang.Object getPolicyAttribute(java.lang.String name)
          Get the value of for one of the policy attributes.
 java.lang.String getPolicyType()
          Returns the associated Type object.
 Type getType()
          Returns the associated Type object.
 java.util.List listQueryableAttributes()
           
 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 removePolicyAttribute(java.lang.String name)
           
 void removePolicyAttributes(java.lang.String[] names)
           
 void setAssignmentMessage(Message m)
          Set the description of the policy.
 void setAttributes(GenericObject wsa)
           
 void setDescription(java.lang.String d)
          Set the description of the policy.
 void setImplementation(java.lang.String i)
          Set the policy implementation class name.
 void setPolicyAttribute(java.lang.String name, java.lang.Object value)
          Set the value of a policy attribute.
 void setPolicyAttribute(java.lang.String name, java.lang.Object[] values)
          Set the values of a multi-valued policy attribute.
 void visit(Visitor v)
          Visitor interface.
 
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, getReferences, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, listQueryableReferenceAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, 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
 

Field Detail

code_id

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

MIN_NUMERIC

public static final java.lang.String MIN_NUMERIC
Attribute constants for a temporary upgrade. These are duplicated in policy.StringQualityPolicy. jsl - brought these over here so we don't depend on StringQualityPolicy to build the object package.

See Also:
Constant Field Values

MIN_SPECIAL

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

MUST_NOT_CONTAIN

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

MUST_NOT_CONTAIN_WORDS

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

PASSWORD_HISTORY_DEPTH

public static final java.lang.String PASSWORD_HISTORY_DEPTH
A policy attribute that specifies the number of previous passwords that should be kept per user, per resource. These previous passwords will be used to validate that a user's new password does not match any of the "history depth" stored previous passwords. All store passwords are one-way hashed for privacy.

See Also:
Constant Field Values

ALL_INTERFACES

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

Policy

public Policy()
Create an empty policy ready for filling.


Policy

public Policy(org.w3c.dom.Element e)
       throws WavesetException
Flesh out policy object by parsing its XML 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

getPolicyType

public java.lang.String getPolicyType()
Returns the associated Type object.


getImplementation

public java.lang.String getImplementation()
Get the name of the policy implementation class.


setImplementation

public void setImplementation(java.lang.String i)
Set the policy implementation class name.

This should only be called by things like PolicyImplementation subclasses as part of the construction of the prototype instance for that implementation.

Applications should never set this as it could change the fundamental nature of the policy.


getDescription

public java.lang.String getDescription()
Return the description of this policy.


setDescription

public void setDescription(java.lang.String d)
Set the description of the policy.


getAssignmentMessage

public Message getAssignmentMessage()
Return the description of this policy.


setAssignmentMessage

public void setAssignmentMessage(Message m)
Set the description of the policy.


getAttributes

public GenericObject getAttributes()
Get the list of policy attributes.

NOTE: This should be used only for browsing, do not modify the objects on this list. Use setAttribute for modification. We might want to have a safer way to access the list?


setAttributes

public void setAttributes(GenericObject wsa)

getPolicyAttribute

public java.lang.Object getPolicyAttribute(java.lang.String name)
Get the value of for one of the policy attributes.

This is a little safer than getAttributes(), but you must still only change the value, changing the name is meaningless. This is probably unnecessary, if you want to change the value use setAttribute instead. // *

// * Sigh, wanted to use use getAttribute(), but that method was defined // * by PersistentObject to mean something else. Since getAttribute // * isn't being used any more, we could switch the names.


removePolicyAttribute

public void removePolicyAttribute(java.lang.String name)

removePolicyAttributes

public void removePolicyAttributes(java.lang.String[] names)

setPolicyAttribute

public void setPolicyAttribute(java.lang.String name,
                               java.lang.Object value)
                        throws WavesetException
Set the value of a policy attribute. Applications should use this rather than directly modifying the GenericObject map returned by getPolicyAttributes.

Might want a variant of this that takes a WSAttribute for symetry with getPolicyAttribute?

Throws:
WavesetException

setPolicyAttribute

public void setPolicyAttribute(java.lang.String name,
                               java.lang.Object[] values)
Set the values of a multi-valued policy attribute. Applications should use this rather than directly modifying the WSAttributes list returned by getPolicyAttributes.


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 PersistentObject 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()

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of PersistentObject exposes as queryable attributes (regardless of whether this 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.


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.


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)