com.att.research.xacmlatt.pdp.policy.PolicyIdReference Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xacml-pdp Show documentation
Show all versions of xacml-pdp Show documentation
ATT reference implementation of XACML PDP engine
The newest version!
/*
*
* Copyright (c) 2013,2019 AT&T Knowledge Ventures
* SPDX-License-Identifier: MIT
*/
package com.att.research.xacmlatt.pdp.policy;
import com.att.research.xacml.api.StatusCode;
import com.att.research.xacmlatt.pdp.eval.EvaluationContext;
import com.att.research.xacmlatt.pdp.eval.EvaluationException;
/**
* PolicyIdReference extends {@link com.att.research.xacmlatt.pdp.policy.PolicyIdReferenceBase} for
* {@link com.att.research.xacmlatt.pdp.policy.Policy} objects with an implementation of the ensureReferencee
* method to find a Policy
.
*
* @author car
* @version $Revision: 1.2 $
*/
public class PolicyIdReference extends PolicyIdReferenceBase {
public PolicyIdReference(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
super(policySetParent, statusCodeIn, statusMessageIn);
}
public PolicyIdReference(StatusCode statusCodeIn, String statusMessageIn) {
super(statusCodeIn, statusMessageIn);
}
public PolicyIdReference(StatusCode statusCodeIn) {
super(statusCodeIn);
}
public PolicyIdReference(PolicySet policySetParent) {
super(policySetParent);
}
public PolicyIdReference() {
}
@Override
protected Policy ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException {
if (this.getReferencee() == null) {
PolicyFinderResult policyFactoryResult = evaluationContext.getPolicy(this.getIdReferenceMatch());
if (policyFactoryResult.getStatus() == null || policyFactoryResult.getStatus().isOk()) {
this.setReferencee(policyFactoryResult.getPolicyDef());
}
}
return this.getReferencee();
}
}