* @return preprocessed obligations
*/
protected Map<String, ObligationType> preprocessObligations(ObligationProcessingContext context) {
HashMap<String, ObligationType> effectiveObligations = new HashMap<String, ObligationType>();
ObligationsType obligations = context.getAuthorizationDecisionResult().getObligations();
if (obligations == null || obligations.getObligations() == null) {
return effectiveObligations;
}
EffectType activeEffect;
if (context.getAuthorizationDecisionResult().getDecision().getDecision() == DECISION.Permit) {
activeEffect = EffectType.Permit;
} else {
activeEffect = EffectType.Deny;
}
for (ObligationType obligation : obligations.getObligations()) {
if (obligation != null && obligation.getFulfillOn() == activeEffect) {
effectiveObligations.put(obligation.getObligationId(), obligation);
}
}