summaryrefslogtreecommitdiffstats
path: root/models-provider/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-01-12 11:52:29 -0500
committerJim Hahn <jrh3@att.com>2021-01-12 12:38:15 -0500
commit9a67d321484b935eaf63e55373088fa64b0ffd76 (patch)
tree334576ddb1d7a736996bd325cf4102fe2215d79c /models-provider/src/main/java
parente926efbc4d5dde8ade1a5521f5be1294079df057 (diff)
Add more methods to query deployment status
Issue-ID: POLICY-2648 Change-Id: I398fa1332eb5a862dabd97ed409ef6413bb0c202 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-provider/src/main/java')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java19
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java14
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java14
3 files changed, 47 insertions, 0 deletions
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
index 65876629c..e0cb44cb6 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
@@ -33,6 +33,7 @@ import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
import org.onap.policy.models.pdp.concepts.PdpPolicyStatus;
import org.onap.policy.models.pdp.concepts.PdpStatistics;
import org.onap.policy.models.pdp.concepts.PdpSubGroup;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
@@ -372,6 +373,24 @@ public interface PolicyModelsProvider extends AutoCloseable {
public List<PdpStatistics> deletePdpStatistics(@NonNull String name, Date timestamp) throws PfModelException;
/**
+ * Gets all policy deployments.
+ *
+ * @return the deployments found
+ * @throws PfModelException on errors getting PDP groups
+ */
+ public List<PdpPolicyStatus> getAllPolicyStatus()
+ throws PfModelException;
+
+ /**
+ * Gets all deployments for a policy.
+ *
+ * @return the deployments found
+ * @throws PfModelException on errors getting PDP groups
+ */
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
+ throws PfModelException;
+
+ /**
* Gets the policy deployments for a PDP group.
*
* @param groupName the name of the PDP group of interest, null to get results for all
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
index f7c58cf19..6b54a1c24 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
@@ -46,6 +46,7 @@ import org.onap.policy.models.pdp.persistence.provider.PdpStatisticsProvider;
import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.provider.PolicyModelsProviderParameters;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
@@ -348,6 +349,19 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
+ public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+ assertInitialized();
+ return new PdpProvider().getAllPolicyStatus(pfDao);
+ }
+
+ @Override
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
+ throws PfModelException {
+ assertInitialized();
+ return new PdpProvider().getAllPolicyStatus(pfDao, policy);
+ }
+
+ @Override
public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName)
throws PfModelException {
assertInitialized();
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
index f0b968c10..0a9ea723f 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
@@ -40,6 +40,7 @@ import org.onap.policy.models.pdp.concepts.PdpStatistics;
import org.onap.policy.models.pdp.concepts.PdpSubGroup;
import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
@@ -241,6 +242,19 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
+ public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+ // Not implemented
+ return new ArrayList<>();
+ }
+
+ @Override
+ public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
+ throws PfModelException {
+ // Not implemented
+ return new ArrayList<>();
+ }
+
+ @Override
public List<PdpPolicyStatus> getGroupPolicyStatus(String groupName) throws PfModelException {
// Not implemented
return new ArrayList<>();