Class BaseFirstOrderFunctionCall.EagerBagEval<RETURN_T extends Value,PARAM_BAG_ELEMENT_T extends AttributeValue>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall<RETURN_T>
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerEval<RETURN_T>
-
- org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerBagEval<RETURN_T,PARAM_BAG_ELEMENT_T>
-
- Type Parameters:
RETURN_T
- function return typePARAM_BAG_ELEMENT_T
- supertype of primitive elements in the parameter bag(s). If these parameter bags have elements of different primitive datatypes, the supertype of all -AttributeValue
- may be specified.
- All Implemented Interfaces:
FirstOrderFunctionCall<RETURN_T>
,FunctionCall<RETURN_T>
- Enclosing class:
- BaseFirstOrderFunctionCall<RETURN extends Value>
public abstract static class BaseFirstOrderFunctionCall.EagerBagEval<RETURN_T extends Value,PARAM_BAG_ELEMENT_T extends AttributeValue> extends BaseFirstOrderFunctionCall.EagerEval<RETURN_T>
Function call, for functions requiring eager (a.k.a. greedy) evaluation of ALL their arguments' expressions to actual values, before the function can be evaluated. All arguments must be bags, therefore no support for primitive values resolved at evaluation time (i.e. remaining args / evaluation-time args are not supported). If some ending parameters are primitive, useBaseFirstOrderFunctionCall.EagerPartlyBagEval
instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall
BaseFirstOrderFunctionCall.EagerBagEval<RETURN_T extends Value,PARAM_BAG_ELEMENT_T extends AttributeValue>, BaseFirstOrderFunctionCall.EagerEval<RETURN_T extends Value>, BaseFirstOrderFunctionCall.EagerMultiPrimitiveTypeEval<RETURN_T extends Value>, BaseFirstOrderFunctionCall.EagerPartlyBagEval<RETURN_T extends Value,PRIMITIVE_PARAM_T extends AttributeValue>, BaseFirstOrderFunctionCall.EagerSinglePrimitiveTypeEval<RETURN_T extends Value,PARAM_T extends AttributeValue>
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall.EagerEval
argExpressions, indeterminateArgMessage, numOfSameTypePrimitiveParamsBeforeBag, totalArgCount
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall
funcId
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EagerBagEval(SingleParameterTypedFirstOrderFunctionSignature<RETURN_T,Bag<PARAM_BAG_ELEMENT_T>> functionSig, List<Expression<?>> args)
Instantiates Function call
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RETURN_T
evaluate(EvaluationContext context, Optional<EvaluationContext> mdpContext, AttributeValue... remainingArgs)
Make the call in a given evaluation context and argument values resolved at evaluation time.protected abstract RETURN_T
evaluate(Bag<PARAM_BAG_ELEMENT_T>[] bagArgs)
Make the call with attribute values as arguments.-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFirstOrderFunctionCall
evaluate, evaluate, getReturnType
-
-
-
-
Constructor Detail
-
EagerBagEval
protected EagerBagEval(SingleParameterTypedFirstOrderFunctionSignature<RETURN_T,Bag<PARAM_BAG_ELEMENT_T>> functionSig, List<Expression<?>> args) throws IllegalArgumentException
Instantiates Function call- Parameters:
functionSig
- function signatureargs
- arguments' Expressions- Throws:
IllegalArgumentException
-
-
Method Detail
-
evaluate
protected abstract RETURN_T evaluate(Bag<PARAM_BAG_ELEMENT_T>[] bagArgs) throws IndeterminateEvaluationException
Make the call with attribute values as arguments. (The pre-evaluation of argument expressions in the evaluation context is already handled internally by this class.)- Parameters:
bagArgs
- function arguments- Returns:
- result of the call
- Throws:
IndeterminateEvaluationException
- if any error evaluating the function
-
evaluate
public RETURN_T evaluate(EvaluationContext context, Optional<EvaluationContext> mdpContext, AttributeValue... remainingArgs) throws IndeterminateEvaluationException
Description copied from interface:FirstOrderFunctionCall
Make the call in a given evaluation context and argument values resolved at evaluation time. This method is called byFirstOrderFunctionCall.evaluate(EvaluationContext, Optional, boolean, AttributeValue...)
after checking evaluation-time args.- Parameters:
context
- Individual Decision evaluation contextmdpContext
- the context of the Multiple Decision request that thecontext
belongs to if the Multiple Decision Profile is usedremainingArgs
- remaining args (not yet known at initialization time). Null if none. Only non-bag/primitive values are validremainingArgs
to prevent varargs warning (potential heap pollution via varargs parameter) that would be caused by using a parameterized type such as Value/Collection to represent both bags and primitives.- Returns:
- result of the call
- Throws:
IndeterminateEvaluationException
- if any error evaluating the function
-
-