public Result combine(EvaluationCtx context, List<CombinerParameter> parameters,
List<? extends CombinerElement> policyElements) {
Iterator<? extends CombinerElement> it = policyElements.iterator();
while (it.hasNext()) {
AbstractPolicy policy = ((PolicyCombinerElement) (it.next())).getPolicy();
// make sure that the policy matches the context
MatchResult match = policy.match(context);
if (match.getResult() == MatchResult.INDETERMINATE)
return new Result(Result.DECISION_INDETERMINATE, match.getStatus(), context
.getResourceId().encode());
if (match.getResult() == MatchResult.MATCH) {
// evaluate the policy
Result result = policy.evaluate(context);
int effect = 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...