import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
import org.onap.policy.models.tosca.utils.ToscaUtils;
return policyList;
}
+ /**
+ * Get filtered policies.
+ *
+ * @param filter the filter for the policies to get
+ * @return the policies found
+ * @throws PfModelException on errors getting policies
+ */
+ public List<ToscaPolicy> getFilteredPolicyList(ToscaTypedEntityFilter<ToscaPolicy> filter) throws PfModelException {
+ String version = ToscaTypedEntityFilter.LATEST_VERSION.equals(filter.getVersion()) ? null : filter.getVersion();
+ return filter.filter(getPolicyList(filter.getName(), version));
+ }
+
/**
* Get policy types.
*
throw pfme;
}
}
+
}