Search in sources :

Example 1 with RangerCachedPolicyEvaluator

use of org.apache.ranger.plugin.policyevaluator.RangerCachedPolicyEvaluator in project ranger by apache.

the class RangerPolicyRepository method buildPolicyEvaluator.

private RangerPolicyEvaluator buildPolicyEvaluator(RangerPolicy policy, RangerServiceDef serviceDef, RangerPolicyEngineOptions options) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> RangerPolicyRepository.buildPolicyEvaluator(" + policy + "," + serviceDef + ", " + options + ")");
    }
    scrubPolicy(policy);
    RangerPolicyEvaluator ret;
    if (StringUtils.equalsIgnoreCase(options.evaluatorType, RangerPolicyEvaluator.EVALUATOR_TYPE_CACHED)) {
        ret = new RangerCachedPolicyEvaluator();
    } else {
        ret = new RangerOptimizedPolicyEvaluator();
    }
    ret.init(policy, serviceDef, options);
    if (LOG.isDebugEnabled()) {
        LOG.debug("<== RangerPolicyRepository.buildPolicyEvaluator(" + policy + "," + serviceDef + "): " + ret);
    }
    return ret;
}
Also used : RangerPolicyEvaluator(org.apache.ranger.plugin.policyevaluator.RangerPolicyEvaluator) RangerOptimizedPolicyEvaluator(org.apache.ranger.plugin.policyevaluator.RangerOptimizedPolicyEvaluator) RangerCachedPolicyEvaluator(org.apache.ranger.plugin.policyevaluator.RangerCachedPolicyEvaluator)

Aggregations

RangerCachedPolicyEvaluator (org.apache.ranger.plugin.policyevaluator.RangerCachedPolicyEvaluator)1 RangerOptimizedPolicyEvaluator (org.apache.ranger.plugin.policyevaluator.RangerOptimizedPolicyEvaluator)1 RangerPolicyEvaluator (org.apache.ranger.plugin.policyevaluator.RangerPolicyEvaluator)1