public interface EvaluationContext
Modifier and Type | Interface and Description |
---|---|
static interface |
EvaluationContext.Listener
Evaluation context listener.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Check whether custom property is in the context
|
net.sf.saxon.s9api.XdmNode |
getAttributesContent(String category)
Returns the <Content> of the <Attibutes> identified by a given category, to be used for AttributeSelector evaluation.
|
<AV extends AttributeValue> |
getAttributeSelectorResult(AttributeSelectorExpression<AV> attributeSelector)
Returns available context evaluation result for a given AttributeSelector.
|
<L extends EvaluationContext.Listener> |
getListener(Class<L> listenerType)
Returns the listener the specified class is mapped to.
|
Iterator<Map.Entry<AttributeFqn,AttributeBag<?>>> |
getNamedAttributes()
Get immutable iterator over the context attributes.
|
<AV extends AttributeValue> |
getNamedAttributeValue(AttributeFqn attributeFQN,
Datatype<AV> datatype)
Returns the value of a named attribute available in the request context.
|
Object |
getOther(String key)
Get custom property
|
<V extends Value> |
getVariableValue(String variableId,
Datatype<V> datatype)
Get value of a VariableDefinition's expression evaluated in this context and whose value has been cached with
putVariableIfAbsent(String, Value) . |
boolean |
isApplicablePolicyIdListRequested()
Equivalent of XACML Request ReturnPolicyIdList attribute.
|
<AV extends AttributeValue> |
putAttributeSelectorResultIfAbsent(AttributeSelectorExpression<AV> attributeSelector,
Bag<AV> result)
Put an Attribute Selector's values in the context, only if the AttributeSelector has not been already evaluated in this context.
|
<L extends EvaluationContext.Listener> |
putListener(Class<L> listenerType,
L listener)
Registers a listener on this evaluation context
|
boolean |
putNamedAttributeValueIfAbsent(AttributeFqn attributeFQN,
AttributeBag<?> result)
Put Attribute values in the context, only if the attribute is not already known to this context.
|
void |
putOther(String key,
Object val)
Puts custom property in the context
|
boolean |
putVariableIfAbsent(String variableId,
Value value)
Caches the value of a VariableDefinition's expression evaluated in this context only if variable is not already set in this context, for later retrieval by
getVariableValue(String, Datatype) when evaluating ValueReferences to the same VariableId. |
Object |
remove(String key)
Removes custom property from the context
|
Value |
removeVariable(String variableId)
Removes a variable (defined by VariableDefinition) from this context.
|
<AV extends AttributeValue> AttributeBag<AV> getNamedAttributeValue(AttributeFqn attributeFQN, Datatype<AV> datatype) throws IndeterminateEvaluationException
AttributeDesignatorExpression
, ContextSelectorId of AttributeSelectorExpression
, or to
get values of attributes on which NamedAttributeProvider
s depends to resolve their own attributes (e.g. some module may need attribute X, such as a subject ID, as input to resolve
attribute Y from an external source, such as subject role from a user database).attributeFQN
- attribute GUID (global ID = Category,Issuer,AttributeId)datatype
- attribute value datatypeIndeterminateEvaluationException
- if error occurred trying to determine the attribute value(s) in context. This is different from finding without error that the attribute is not in the context (and/or no value),
e.g. if there is a result but type is different from attributeDatatype
.Iterator<Map.Entry<AttributeFqn,AttributeBag<?>>> getNamedAttributes()
getNamedAttributeValue(AttributeFqn, Datatype)
instead. This is only for iterating over all the attributes, e.g. for debugging/auditing.boolean putNamedAttributeValueIfAbsent(AttributeFqn attributeFQN, AttributeBag<?> result)
getNamedAttributeValue(AttributeFqn, Datatype)
should be called always before
calling this, for the same attributeFQN
attributeFQN
- attribute's global IDresult
- attribute values<AV extends AttributeValue> Bag<AV> getAttributeSelectorResult(AttributeSelectorExpression<AV> attributeSelector) throws IndeterminateEvaluationException
UnsupportedOperationException
.attributeSelector
- AttributeSelectorIndeterminateEvaluationException
- if error occurred trying to determine the result in context. This is different from finding without error that the result is not in the context (and/or no value), e.g. if there is a
result but type is different from datatypeClass
.<AV extends AttributeValue> boolean putAttributeSelectorResultIfAbsent(AttributeSelectorExpression<AV> attributeSelector, Bag<AV> result) throws IndeterminateEvaluationException
getAttributeSelectorResult(AttributeSelectorExpression)
should be called always before calling this, for the same attributeSelector
attributeSelector
- AttributeSelectorresult
- AttributeSelector value bagIndeterminateEvaluationException
- if AttributeSelector evaluation is not supported (this is an optional feature of XACML specification)net.sf.saxon.s9api.XdmNode getAttributesContent(String category)
category
- category of the Attributes element from which to get the Content.<V extends Value> V getVariableValue(String variableId, Datatype<V> datatype) throws IndeterminateEvaluationException
putVariableIfAbsent(String, Value)
. To be used when evaluating
VariableReferences.variableId
- identifies the VariableDefinitiondatatype
- datatypeIndeterminateEvaluationException
- if actual datatype of variable value in context does not match expected datatype
boolean putVariableIfAbsent(String variableId, Value value)
getVariableValue(String, Datatype)
when evaluating ValueReferences to the same VariableId.
The variable is set only if it was absent from context. In other words, this method does/must not allow setting the same variable twice. The reason is compliance with XACML spec 7.8 VariableReference evaluation: "the value of an Expression element remains the same for the entire policy evaluation."
variableId
- identifies the VariableDefinitionvalue
- value of the VariableDefinition's expression evaluated in this contextValue removeVariable(String variableId)
variableId
- identifies the Variable to removeObject getOther(String key)
key
- Map.get(Object)
boolean containsKey(String key)
key
- Map.containsKey(Object)
void putOther(String key, Object val)
key
- val
- Map.put(Object, Object)
Object remove(String key)
key
- Map.remove(Object)
boolean isApplicablePolicyIdListRequested()
DecisionResult.getApplicablePolicies()
.<L extends EvaluationContext.Listener> L putListener(Class<L> listenerType, L listener)
listenerType
- listener type used as key for retrieving the listener with getListener(Class)
listener
- <L extends EvaluationContext.Listener> L getListener(Class<L> listenerType)
listenerType
- listener type, used as key to retrieve the listener registered with this type with putListener(Class, Listener)
Copyright © 2012–2020. All rights reserved.