public abstract class AbstractPolicy extends Object implements PolicyTreeElement
Modifier | Constructor and Description |
---|---|
protected |
AbstractPolicy()
Constructor used by
PolicyReference , which supplies
its own values for the methods in this class. |
protected |
AbstractPolicy(Node root,
String policyPrefix,
String combiningName)
Constructor used by child classes to initialize the shared data from
a DOM root node.
|
protected |
AbstractPolicy(URI id,
String version,
CombiningAlgorithm combiningAlg,
String description,
Target target)
Constructor used to create a policy from concrete components.
|
protected |
AbstractPolicy(URI id,
String version,
CombiningAlgorithm combiningAlg,
String description,
Target target,
String defaultVersion)
Constructor used to create a policy from concrete components.
|
protected |
AbstractPolicy(URI id,
String version,
CombiningAlgorithm combiningAlg,
String description,
Target target,
String defaultVersion,
Set obligations,
List parameters)
Constructor used to create a policy from concrete components.
|
Modifier and Type | Method and Description |
---|---|
protected void |
encodeCommonElements(OutputStream output,
Indenter indenter)
Routine used by
Policy and PolicySet to
encode some common elements. |
Result |
evaluate(EvaluationCtx context)
Tries to evaluate the policy by calling the combining algorithm on
the given policies or rules.
|
List |
getChildElements()
Returns the
List of CombinerElement s that
is provided to the combining algorithm. |
List |
getChildren()
Returns the
List of children under this node in the
policy tree. |
CombiningAlgorithm |
getCombiningAlg()
Returns the combining algorithm used by this policy
|
List |
getCombiningParameters()
Returns the list of input parameters for the combining algorithm.
|
String |
getDefaultVersion()
Returns the XPath version to use or null if none was specified
|
String |
getDescription()
Returns the given description of this policy or null if there is no
description
|
URI |
getId()
Returns the id of this policy
|
PolicyMetaData |
getMetaData()
Returns the meta-data associated with this policy
|
Set |
getObligations()
Returns the Set of obligations for this policy, which may be empty
|
Target |
getTarget()
Returns the target for this policy
|
String |
getVersion()
Returns the version of this policy.
|
MatchResult |
match(EvaluationCtx context)
Given the input context sees whether or not the request matches this
policy.
|
protected void |
setChildren(List children)
Sets the child policy tree elements for this node, which are passed
to the combining algorithm on evaluation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encode, encode
protected AbstractPolicy()
PolicyReference
, which supplies
its own values for the methods in this class.protected AbstractPolicy(URI id, String version, CombiningAlgorithm combiningAlg, String description, Target target)
id
- the policy idversion
- the policy version or null for the default (this is
always null for pre-2.0 policies)combiningAlg
- the combining algorithm to usedescription
- describes the policy or null if there is nonetarget
- the policy's targetprotected AbstractPolicy(URI id, String version, CombiningAlgorithm combiningAlg, String description, Target target, String defaultVersion)
id
- the policy idversion
- the policy version or null for the default (this is
always null for pre-2.0 policies)combiningAlg
- the combining algorithm to usedescription
- describes the policy or null if there is nonetarget
- the policy's targetdefaultVersion
- the XPath version to use for selectorsprotected AbstractPolicy(URI id, String version, CombiningAlgorithm combiningAlg, String description, Target target, String defaultVersion, Set obligations, List parameters)
id
- the policy idversion
- the policy version or null for the default (this is
always null for pre-2.0 policies)combiningAlg
- the combining algorithm to usedescription
- describes the policy or null if there is nonetarget
- the policy's targetdefaultVersion
- the XPath version to use for selectorsobligations
- the policy's obligationsprotected AbstractPolicy(Node root, String policyPrefix, String combiningName) throws ParsingException
root
- the DOM root of the policypolicyPrefix
- either "Policy" or "PolicySet"combiningName
- name of the field naming the combining algParsingException
- if the policy is invalidpublic URI getId()
getId
in interface PolicyTreeElement
public String getVersion()
"1.0"
.public CombiningAlgorithm getCombiningAlg()
public List getCombiningParameters()
List
of CombinerParameter
spublic String getDescription()
getDescription
in interface PolicyTreeElement
public Target getTarget()
getTarget
in interface PolicyTreeElement
public String getDefaultVersion()
public List getChildren()
List
of children under this node in the
policy tree. Depending on what kind of policy this node represents
the children will either be AbstractPolicy
objects
or Rule
s.getChildren
in interface PolicyTreeElement
List
of child nodespublic List getChildElements()
List
of CombinerElement
s that
is provided to the combining algorithm. This returns the same set
of children that getChildren
provides along with any
associated combiner parameters.List
of CombinerElement
spublic Set getObligations()
public PolicyMetaData getMetaData()
public MatchResult match(EvaluationCtx context)
match
in interface PolicyTreeElement
context
- the representation of the requestprotected void setChildren(List children)
List
must
contain CombinerElement
s, which in turn will contain
Rule
s or AbstractPolicy
s, but may not
contain both types of elements.children
- a List
of CombinerElement
s
representing the child elements used by the combining
algorithmpublic Result evaluate(EvaluationCtx context)
match
method must always
be called first, and must always return MATCH, before this method
is called.evaluate
in interface PolicyTreeElement
context
- the representation of the requestprotected void encodeCommonElements(OutputStream output, Indenter indenter)
Policy
and PolicySet
to
encode some common elements.output
- a stream into which the XML-encoded data is writtenindenter
- an object that creates indentation stringsCopyright © 2023 JBoss by Red Hat. All rights reserved.