public class Target extends AbstractTarget
| Constructor and Description |
|---|
Target(TargetSection subjectsSection,
TargetSection resourcesSection,
TargetSection actionsSection)
Constructor that creates an XACML 1.x
Target from components. |
Target(TargetSection subjectsSection,
TargetSection resourcesSection,
TargetSection actionsSection,
TargetSection environmentsSection)
Constructor that creates an XACML 2.0
Target from components. |
| Modifier and Type | Method and Description |
|---|---|
String |
encode()
Encodes this
Target into its XML form |
void |
encode(StringBuilder builder)
Encodes this
Target into its XML form and writes this out to the provided
StringBuilder |
TargetSection |
getActionsSection()
Returns the Actions section of this Target.
|
TargetSection |
getEnvironmentsSection()
Returns the Environments section of this Target.
|
static Target |
getInstance(Node root,
PolicyMetaData metaData)
Creates a
Target by parsing a node. |
static Target |
getInstance(Node root,
String xpathVersion)
Deprecated.
As of 2.0 you should avoid using this method and should instead use the version
that takes a
PolicyMetaData instance. This method will only work for
XACML 1.x policies. |
TargetSection |
getResourcesSection()
Returns the Resources section of this Target.
|
TargetSection |
getSubjectsSection()
Returns the Subjects section of this Target.
|
MatchResult |
match(EvaluationCtx context)
Determines whether this
Target matches the input request (whether it is
applicable). |
boolean |
matchesAny()
Returns whether or not this
Target matches any request. |
public Target(TargetSection subjectsSection, TargetSection resourcesSection, TargetSection actionsSection)
Target from components. Each of the
sections must be non-null, but they may match any request. Because this is only used for 1.x
Targets, there is no Environments section.subjectsSection - a TargetSection representing the Subjects section of this
targetresourcesSection - a TargetSection representing the Resources section of
this targetactionsSection - a TargetSection representing the Actions section of this
targetpublic Target(TargetSection subjectsSection, TargetSection resourcesSection, TargetSection actionsSection, TargetSection environmentsSection)
Target from components. Each of the
sections must be non-null, but they may match any request.subjectsSection - a TargetSection representing the Subjects section of this
targetresourcesSection - a TargetSection representing the Resources section of
this targetactionsSection - a TargetSection representing the Actions section of this
targetenvironmentsSection - a TargetSection representing the Environments section
of this targetpublic static Target getInstance(Node root, String xpathVersion) throws ParsingException
PolicyMetaData instance. This method will only work for
XACML 1.x policies.Target by parsing a node.root - the node to parse for the TargetxpathVersion - the XPath version to use in any selectors, or null if this is unspecified
(ie, not supplied in the defaults section of the policy)Target constructed by parsingParsingException - if the DOM node is invalidpublic static Target getInstance(Node root, PolicyMetaData metaData) throws ParsingException
Target by parsing a node.root - the node to parse for the TargetmetaData - Target constructed by parsingParsingException - if the DOM node is invalidpublic TargetSection getSubjectsSection()
TargetSection representing the Subjectspublic TargetSection getResourcesSection()
TargetSection representing the Resourcespublic TargetSection getActionsSection()
TargetSection representing the Actionspublic TargetSection getEnvironmentsSection()
TargetSection representing the Environmentspublic boolean matchesAny()
Target matches any request.public MatchResult match(EvaluationCtx context)
Target matches the input request (whether it is
applicable).match in class AbstractTargetcontext - the representation of the requestpublic String encode()
Target into its XML formencode in class AbstractTargetStringpublic void encode(StringBuilder builder)
Target into its XML form and writes this out to the provided
StringBuilderencode in class AbstractTargetbuilder - string stream into which the XML-encoded data is writtenCopyright © 2024 WSO2. All rights reserved.