com.ibm.xml.policy.xacl
Class Parameter
java.lang.Object
|
+--com.ibm.xml.policy.xacl.Parameter
- public class Parameter
- extends java.lang.Object
A class correspoding to the <parameter> tag.
- Author:
- Satoshi Hada, IBM TRL
|
Method Summary |
org.w3c.dom.Node[] |
evaluate(AccessRequest accessReq,
org.w3c.dom.Node query,
DOMHandler targetDocHandler,
org.w3c.dom.Element status)
This method evaluates this parameter and returns an array of nodes as a result. |
org.w3c.dom.Element |
getElement()
Get the original element from which this object is constructed. |
java.lang.String |
getName()
Get the value of the name attribute. |
java.lang.String |
getValue()
Get the value of the value attribute. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getName
public java.lang.String getName()
- Get the value of the name attribute.
getValue
public java.lang.String getValue()
- Get the value of the value attribute.
getElement
public org.w3c.dom.Element getElement()
- Get the original element from which this object is constructed.
- Returns:
- the original element
evaluate
public org.w3c.dom.Node[] evaluate(AccessRequest accessReq,
org.w3c.dom.Node query,
DOMHandler targetDocHandler,
org.w3c.dom.Element status)
throws XaclException
- This method evaluates this parameter and returns an array of nodes as a result.
If the parameter has a <function> element as a child then
the evaluation result of the function will be returned.
Otherwise, this method just returns the child nodes of the parameter.
Recall that the <parameter> tags can have any child nodes.
- Case 1: A "value" attribute is specified
Suppose that there is the following <parameter> element:
<parameter value="Access Control"/>
Then this method returns an array including a text node
representing "Access Control".
- Case 2: No value attribute, but one or more child nodes are specified
Suppose that there is the following <parameter> element:
<parameter>
<name>category</name>
<value>Access Control</value>
</parameter>
Then this method returns an array including the two child elements,
i.e., the <name> and <value> elements.
- Case 3: A <function> element is specified
Suppose that there is the following <parameter> element that has a
<function> child element:
<parameter>
<function name="getUid"/>
</parameter>
The "getUid" function will return a text node represeting the
initiator's uid. Intuitively, after the "getUid" function is evaluated,
the function element is replaced by the evaluation result as follows:
<parameter>
Alice
</parameter>
This corresonds to Case 2 above. Therefore, this method returns
an array including the text node "Alice".
The function is evaluated via the FunctionInterface interface.
The first parameter "query" represents a node for which the policy is
currently evaluated. This may not always be the same as
the requested target node specified in the access request
because the evaluation is done for the subtree of the requested target node.
- Parameters:
accessReq - an access requestquery - a node for which the policy is currently evaluatedtargetDocHandler - a handler of a target documentstatus - a <status> element associated with the target document.- Returns:
- the result of the evaluation.
- See Also:
FunctionInterface,
PredicateInterface,
ProvisionalActionInterface