public PolicyBean getPolicy(PolicyType type, String organizationId, String entityId,
        String entityVersion, long policyId) throws PolicyNotFoundException {

        PolicyBean policy = tryAction(() -> storage.getPolicy(type, organizationId, entityId, entityVersion, policyId));
        if (policy == null) {
            throw ExceptionFactory.policyNotFoundException(policyId);
        }
        if (policy.getType() != type) {
            throw ExceptionFactory.policyNotFoundException(policyId);
        }
        if (!policy.getOrganizationId().equals(organizationId)) {
            throw ExceptionFactory.policyNotFoundException(policyId);
        }
        if (!policy.getEntityId().equals(entityId)) {
            throw ExceptionFactory.policyNotFoundException(policyId);
        }
        if (!policy.getEntityVersion().equals(entityVersion)) {
            throw ExceptionFactory.policyNotFoundException(policyId);
        }
        tryAction(() -> PolicyTemplateUtil.generatePolicyDescription(policy));
        return policy;
    }
Gets a policy by its id.  Also verifies that the policy really does belong to
the entity indicated.
@param type the policy type
@param organizationId the org id
@param entityId the entity id
@param entityVersion the entity version
@param policyId the policy id
@return a policy bean
@throws PolicyNotFoundException
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/PolicyService.java