// based on the type, see if we have any references available, and
// if we do then get the filename
if (type == PolicyReference.POLICY_REFERENCE) {
if (policyRefs == null)
return new PolicyFinderResult();
fileName = (String) (policyRefs.get(idReference.toString()));
} else {
if (policySetRefs == null)
return new PolicyFinderResult();
fileName = (String) (policySetRefs.get(idReference.toString()));
}
// if we had no mapping available, return with no referenced policy
if (fileName == null)
return new PolicyFinderResult();
// append the correct prefix to the filename
if (type == PolicyReference.POLICY_REFERENCE)
fileName = policyRefPrefix + fileName;
else
fileName = policySetRefPrefix + fileName;
// load the referenced policy
AbstractPolicy policy = loadPolicy(fileName, finder);
// if there was an error loading the policy, return the error
if (policy == null) {
ArrayList<String> code = new ArrayList<String>();
code.add(Status.STATUS_PROCESSING_ERROR);
Status status = new Status(code, "couldn't load referenced policy");
return new PolicyFinderResult(status);
}
// return the referenced policy
return new PolicyFinderResult(policy);
}