|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.AbstractTarget
org.wso2.balana.xacml2.Target
public class Target
Represents the TargetType XML type in XACML. This also stores several other XML types: Subjects, Resources, Actions, and Environments (in XACML 2.0 and later). The target is used to quickly identify whether the parent element (a policy set, policy, or rule) is applicable to a given request.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 targetMethod Detail |
---|
public 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 Target
xpathVersion
- 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 parsing
ParsingException
- 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 Target
metaData
-
Target
constructed by parsing
ParsingException
- 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 AbstractTarget
context
- the representation of the request
public String encode()
Target
into its XML form
encode
in class AbstractTarget
String
public void encode(StringBuilder builder)
Target
into its XML form and writes this out to the provided
StringBuilder
- Specified by:
encode
in class AbstractTarget
- Parameters:
builder
- string stream into which the XML-encoded data is written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |