public class Target extends Object
| 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 |
|---|---|
void |
encode(OutputStream output)
Encodes this
Target into its XML representation and writes
this encoding to the given OutputStream with no
indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this
Target into its XML representation and writes
this encoding to the given OutputStream with
indentation. |
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 TargetTarget 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).context - the representation of the requestpublic void encode(OutputStream output)
Target into its XML representation and writes
this encoding to the given OutputStream with no
indentation.output - a stream into which the XML-encoded data is writtenpublic void encode(OutputStream output, Indenter indenter)
Target into its XML representation and writes
this encoding to the given OutputStream with
indentation.output - a stream into which the XML-encoded data is writtenindenter - an object that creates indentation stringsCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.