+ * Gets all policy deployments.
+ *
+ * @param dao the DAO to use to access the database
+ * @return the deployments found
+ * @throws PfModelException on errors getting PDP groups
+ */
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao)
+ throws PfModelException {
+
+ return dao.getAll(JpaPdpPolicyStatus.class).stream().map(JpaPdpPolicyStatus::toAuthorative)
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Gets all deployments for a policy.
+ *
+ * @param dao the DAO to use to access the database
+ * @return the deployments found
+ * @throws PfModelException on errors getting PDP groups
+ */
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao,
+ @NonNull ToscaConceptIdentifierOptVersion policy) throws PfModelException {
+
+ if (policy.getVersion() != null) {
+ return dao.getAll(JpaPdpPolicyStatus.class, new PfConceptKey(policy.getName(), policy.getVersion()))
+ .stream().map(JpaPdpPolicyStatus::toAuthorative).collect(Collectors.toList());
+
+ } else {
+ return dao.getAllVersionsByParent(JpaPdpPolicyStatus.class, policy.getName()).stream()
+ .map(JpaPdpPolicyStatus::toAuthorative).collect(Collectors.toList());
+ }
+ }
+
+ /**
+ * Gets the policy deployments for a PDP group.