|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.TargetMatch
public class TargetMatch
Represents the SubjectMatch, ResourceMatch, ActionMatch, or EnvironmentMatch (in XACML 2.0 and later) XML types in XACML, depending on the value of the type field. This is the part of the Target that actually evaluates whether the specified attribute values in the Target match the corresponding attribute values in the request context.
Field Summary | |
---|---|
static int |
ACTION
An integer value indicating that this class represents an ActionMatch |
static int |
ENVIRONMENT
An integer value indicating that this class represents an EnvironmentMatch |
static String[] |
NAMES
Mapping from the 4 match types to their string representations |
static int |
RESOURCE
An integer value indicating that this class represents a ResourceMatch |
static int |
SUBJECT
An integer value indicating that this class represents a SubjectMatch |
Constructor Summary | |
---|---|
TargetMatch(Function function,
Evaluatable eval,
AttributeValue attrValue)
Constructor that creates a TargetMatch from components. |
|
TargetMatch(int type,
Function function,
Evaluatable eval,
AttributeValue attrValue)
Constructor that creates a TargetMatch from components. |
Method Summary | |
---|---|
void |
encode(StringBuilder builder)
Encodes this TargetMatch into its XML form and writes this out to the provided
StringBuilder |
static TargetMatch |
getInstance(Node root,
int matchType,
PolicyMetaData metaData)
Creates a TargetMatch by parsing a node, using the input prefix to determine
whether this is a SubjectMatch, ResourceMatch, or ActionMatch. |
static TargetMatch |
getInstance(Node root,
PolicyMetaData metaData)
|
static TargetMatch |
getInstance(Node root,
String prefix,
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. |
Evaluatable |
getMatchEvaluatable()
Returns the AttributeDesignator or AttributeSelector used by the
matching function. |
Function |
getMatchFunction()
Returns the Function used to do the matching. |
AttributeValue |
getMatchValue()
Returns the AttributeValue used by the matching function. |
int |
getType()
Returns the type of this TargetMatch , either SUBJECT ,
RESOURCE , ACTION , or ENVIRONMENT . |
MatchResult |
match(EvaluationCtx context)
Determines whether this TargetMatch matches the input request (whether it is
applicable) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUBJECT
public static final int RESOURCE
public static final int ACTION
public static final int ENVIRONMENT
public static final String[] NAMES
Constructor Detail |
---|
public TargetMatch(int type, Function function, Evaluatable eval, AttributeValue attrValue) throws IllegalArgumentException
TargetMatch
from components.
type
- an integer indicating whether this class represents a SubjectMatch,
ResourceMatch, or ActionMatchfunction
- the Function
that represents the MatchIdeval
- the AttributeDesignator
or AttributeSelector
to be used
to select attributes from the request contextattrValue
- the AttributeValue
to compare against
IllegalArgumentException
- if the input type isn't a valid valuepublic TargetMatch(Function function, Evaluatable eval, AttributeValue attrValue) throws IllegalArgumentException
TargetMatch
from components.
function
- the Function
that represents the MatchIdeval
- the AttributeDesignator
or AttributeSelector
to be used
to select attributes from the request contextattrValue
- the AttributeValue
to compare against
IllegalArgumentException
- if the input type isn't a valid valueMethod Detail |
---|
public static TargetMatch getInstance(Node root, String prefix, String xpathVersion) throws ParsingException, IllegalArgumentException
PolicyMetaData
instance. This method will only work for
XACML 1.x policies.
TargetMatch
by parsing a node, using the input prefix to determine
whether this is a SubjectMatch, ResourceMatch, or ActionMatch.
root
- the node to parse for the TargetMatch
prefix
- a String indicating what type of TargetMatch
to instantiate
(Subject, Resource, or Action)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)
TargetMatch
constructed by parsing
ParsingException
- if there was an error during parsing
IllegalArgumentException
- if the input prefix isn't a valid valuepublic static TargetMatch getInstance(Node root, PolicyMetaData metaData) throws ParsingException
ParsingException
public static TargetMatch getInstance(Node root, int matchType, PolicyMetaData metaData) throws ParsingException
TargetMatch
by parsing a node, using the input prefix to determine
whether this is a SubjectMatch, ResourceMatch, or ActionMatch.
root
- the node to parse for the TargetMatch
matchType
- the type of TargetMatch
as specified by the SUBJECT, RESOURCE,
ACTION, or ENVIRONMENT fieldsmetaData
- the policy's meta-data
TargetMatch
constructed by parsing
ParsingException
- if there was an error during parsingpublic int getType()
TargetMatch
, either SUBJECT
,
RESOURCE
, ACTION
, or ENVIRONMENT
.
public Function getMatchFunction()
Function
used to do the matching.
public AttributeValue getMatchValue()
AttributeValue
used by the matching function.
AttributeValue
for the matchpublic Evaluatable getMatchEvaluatable()
AttributeDesignator
or AttributeSelector
used by the
matching function.
public MatchResult match(EvaluationCtx context)
TargetMatch
matches the input request (whether it is
applicable)
context
- the representation of the request
public void encode(StringBuilder builder)
TargetMatch
into its XML form and writes this out to the provided
StringBuilder
- 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 |