|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.object.RoleAttribute
An object representing a Role Attribute.
Role Attributes modify resource account attributes values. the following modifications are supported:
AttributeRequirement.REQ_DEFAULT = "Default value"; AttributeRequirement.REQ_FORCE = "Set to value"; AttributeRequirement.REQ_MERGE = "Merge with value"; AttributeRequirement.REQ_MERGE_WITH_CLEAR = "Merge with value, clear existing"; AttributeRequirement.REQ_REMOVE
All role attributes on a User are gathered, sorted by attribute and action, and applied. Conflicts may cause errors. The most common conflicts are:
- multiple default values (warn but not error) - multiple set values (error) MultipleAttributeSet exception - set with delete or merge (error) ConflictingAttributeSet exception - delete with merge (warning ?) ConflictingAttributeSet exception
Nested Class Summary | |
static class |
RoleAttribute.AttributeRequirement
|
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
EL_ATTRIBUTE_NAME
|
static java.lang.String |
EL_COMMENT
|
static java.lang.String |
EL_REQUIREMENT
|
static java.lang.String |
EL_RESOURCE
|
static java.lang.String |
EL_VALUE
|
static java.lang.String |
EL_VALUE_TYPE
|
static java.lang.String |
ELEMENT
Name of the serialized XML element. |
protected static Trace |
trace
|
Fields inherited from class com.waveset.util.AbstractXmlObject |
_trace |
Constructor Summary | |
RoleAttribute()
Builds an empty Role Attribute. |
|
RoleAttribute(org.w3c.dom.Element e)
Builds a Rule from XML. |
|
RoleAttribute(java.lang.String resourceName,
java.lang.String attributeName,
RoleAttribute.AttributeRequirement requirement,
java.lang.Object value)
|
|
RoleAttribute(java.lang.String resourceName,
java.lang.String attributeName,
RoleAttribute.AttributeRequirement requirement,
ObjectRef ruleRef)
|
Method Summary | |
static java.lang.String |
checkConflict(RoleAttribute potentialConflict,
RoleAttribute ra)
Check for a conflict between the two role attributes. |
static java.util.List |
checkConflicts(java.util.List attrs)
Check for conflicts in the list of role attributes. |
int |
compareTo(java.lang.Object o)
Implement the comparable interface so that lists of these will have a reasonable contains() implementation. |
java.lang.Object |
eval(ExState state)
Evaluate the rule in a given expression environment. |
java.lang.String |
getAttributeName()
|
java.lang.Object |
getAttributeValue()
|
ObjectCache |
getCache()
|
java.lang.String |
getComments()
|
java.lang.String |
getContainerName()
|
java.lang.String |
getElementName()
Return the element name. |
java.lang.String |
getName()
Get the name. |
RoleAttribute.AttributeRequirement |
getRequirement()
|
static java.util.List |
getRequirementKeys()
|
static java.util.List |
getRequirementKeys(java.lang.Object bogus)
Return a list with entries: localizedKey1 key1 ... |
static java.util.List |
getRequirements()
|
java.lang.String |
getResourceName()
|
ObjectRef |
getResourceRef()
|
int |
hashCode()
Implement the hashCode for efficient map insertion. |
boolean |
isAuthoritative()
|
boolean |
isClear()
|
boolean |
isCSV()
|
boolean |
isDefault()
|
boolean |
isSameTargetAttribute(RoleAttribute ra)
Return true if this attribute matches the resource and attribute name |
void |
parseXml(org.w3c.dom.Element e)
|
static java.util.ArrayList |
parseXmlList(org.w3c.dom.Element e)
Builds an ArrayList of reference objects by parsing the XML representation of a reference list. |
void |
removeAuthoritativeValue(GenericObject view,
java.lang.String path,
java.lang.Object value)
Remove the values for an authoritative role attribute from the current view value. |
void |
resolveResourceRef()
The resource, if any, that's tracked by this RoleAttribute can become stale. |
void |
setAttributeName(java.lang.String s)
|
void |
setAttributeValue(java.lang.Object o)
|
void |
setCache(ObjectCache cache)
|
void |
setComments(java.lang.String s)
|
void |
setContainerName(java.lang.String name)
|
void |
setCSV(boolean b)
|
void |
setName(java.lang.String name)
|
void |
setRequirement(RoleAttribute.AttributeRequirement ar)
|
void |
setResource(java.lang.String nameOrId)
|
void |
setResourceRef(ObjectRef or)
|
boolean |
setViewAttribute(GenericObject view,
java.lang.String path,
java.lang.Object value)
Put the given object in the view at the given path. |
static void |
sortToEvaluationOrder(java.util.List attrs)
Sort a List of role attributes. |
java.lang.String |
toString()
Our string representation is |
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize into a buffer with optional indentation. |
Methods inherited from class com.waveset.util.AbstractXmlObject |
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String ELEMENT
protected static final Trace trace
public static final java.lang.String EL_RESOURCE
public static final java.lang.String EL_REQUIREMENT
public static final java.lang.String EL_VALUE
public static final java.lang.String EL_VALUE_TYPE
public static final java.lang.String EL_COMMENT
public static final java.lang.String EL_ATTRIBUTE_NAME
Constructor Detail |
public RoleAttribute()
public RoleAttribute(org.w3c.dom.Element e) throws WavesetException
public RoleAttribute(java.lang.String resourceName, java.lang.String attributeName, RoleAttribute.AttributeRequirement requirement, java.lang.Object value) throws WavesetException
public RoleAttribute(java.lang.String resourceName, java.lang.String attributeName, RoleAttribute.AttributeRequirement requirement, ObjectRef ruleRef) throws WavesetException
Method Detail |
public java.lang.String getElementName()
AbstractXmlObject
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getComments()
public void setComments(java.lang.String s)
public java.lang.String getAttributeName()
public void setAttributeName(java.lang.String s)
public java.lang.Object getAttributeValue()
public void setAttributeValue(java.lang.Object o)
public RoleAttribute.AttributeRequirement getRequirement()
public void setRequirement(RoleAttribute.AttributeRequirement ar)
public static java.util.List getRequirements()
public static java.util.List getRequirementKeys(java.lang.Object bogus)
public static java.util.List getRequirementKeys()
public ObjectRef getResourceRef()
public java.lang.String getResourceName()
public void setResource(java.lang.String nameOrId)
public void setResourceRef(ObjectRef or)
public void setCache(ObjectCache cache)
public ObjectCache getCache()
public void setContainerName(java.lang.String name)
public java.lang.String getContainerName()
public boolean isAuthoritative()
public boolean isDefault()
public boolean isClear()
public boolean isCSV()
public void setCSV(boolean b)
public java.lang.Object eval(ExState state) throws WavesetException
WavesetException
public boolean setViewAttribute(GenericObject view, java.lang.String path, java.lang.Object value)
view
- - the view to operate onpath
- - the path of the attribute to update
public void removeAuthoritativeValue(GenericObject view, java.lang.String path, java.lang.Object value)
public void toXml(java.lang.StringBuffer b, int indent)
AbstractXmlObject
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
public void parseXml(org.w3c.dom.Element e) throws WavesetException
WavesetException
public static java.util.ArrayList parseXmlList(org.w3c.dom.Element e) throws WavesetException
The provided element is expected to be the wrapper elements, its
name is unimportant. We extract any
WavesetException
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
public static java.lang.String checkConflict(RoleAttribute potentialConflict, RoleAttribute ra)
public int hashCode()
public static java.util.List checkConflicts(java.util.List attrs)
public static void sortToEvaluationOrder(java.util.List attrs)
public boolean isSameTargetAttribute(RoleAttribute ra)
public void resolveResourceRef()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |