/** * Applies the combining rule to the set of rules based on the * evaluation context. * * @param context the context from the request * @param parameters a (possibly empty) non-null <code>List</code> of * <code>CombinerParameter<code>s * @param ruleElements the rules to combine * * @return the result of running the combining algorithm */ public Result combine(EvaluationCtx context, List parameters, List ruleElements) { Iterator it = ruleElements.iterator(); while (it.hasNext()) { Rule rule = ((RuleCombinerElement)(it.next())).getRule(); Result result = rule.evaluate(context); int value = result.getDecision(); // in the case of PERMIT, DENY, or INDETERMINATE, we always // just return that result, so only on a rule that doesn't // apply do we keep going... if (value != Result.DECISION_NOT_APPLICABLE) return result; } // if we got here, then none of the rules applied return new Result(Result.DECISION_NOT_APPLICABLE, context.getResourceId().encode()); }
Result result = rule.evaluate(context); int value = result.getDecision();
Result result = rule.evaluate(context); int value = result.getDecision();