- public void updatePdpStatistics(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
- @NonNull final String pdpType, @NonNull final String pdpInstanceId,
- @NonNull final PdpStatistics pdpStatistics) throws PfModelException {
- // Not implemented yet
+ 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());
+ }