summaryrefslogtreecommitdiffstats
path: root/models-provider
diff options
context:
space:
mode:
Diffstat (limited to 'models-provider')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java9
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java6
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java5
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java7
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java5
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java3
6 files changed, 6 insertions, 29 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 8782a6928..85aab6ec4 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
@@ -320,15 +320,6 @@ public interface PolicyModelsProvider extends AutoCloseable {
*/
public PdpGroup deletePdpGroup(@NonNull final String name) throws PfModelException;
- /**
- * Get PDP statistics.
- *
- * @param name the name of the PDP group to get statistics for, null to get all PDP groups
- * @return the statistics found
- * @throws PfModelException on errors getting statistics
- */
- public List<PdpStatistics> getPdpStatistics(final String name, final Instant timestamp) throws PfModelException;
-
/**
* Get filtered PdpStatistics.
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 95300e62d..05722d71b 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
@@ -251,12 +251,6 @@ public class DatabasePolicyModelsProviderImpl extends AbstractModelsProvider imp
}
@Override
- public List<PdpStatistics> getPdpStatistics(final String name, final Instant timestamp) throws PfModelException {
- assertInitialized();
- return new PdpStatisticsProvider().getPdpStatistics(getPfDao(), name, timestamp);
- }
-
- @Override
public List<PdpStatistics> getFilteredPdpStatistics(PdpFilterParameters filterParams) throws PfModelException {
assertInitialized();
return new PdpStatisticsProvider().getFilteredPdpStatistics(getPfDao(), filterParams);
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 e705ae3ed..b9b34a24d 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
@@ -214,11 +214,6 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public List<PdpStatistics> getPdpStatistics(final String name, final Instant timestamp) throws PfModelException {
- return new ArrayList<>();
- }
-
- @Override
public List<PdpStatistics> getFilteredPdpStatistics(PdpFilterParameters filterParams) throws PfModelException {
// Not implemented
return new ArrayList<>();
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
index de7b28a60..57c261cb5 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
@@ -412,7 +412,7 @@ public class DatabasePolicyModelsProviderTest {
List<PdpStatistics> statisticsArrayList = makePdpStatisticsList();
- assertThat(databaseProvider.getPdpStatistics(null, null)).isEmpty();
+ assertThat(databaseProvider.getFilteredPdpStatistics(PdpFilterParameters.builder().build())).isEmpty();
assertThat(databaseProvider.createPdpStatistics(statisticsArrayList)).hasSize(1);
assertThat(databaseProvider.updatePdpStatistics(statisticsArrayList)).hasSize(1);
}
@@ -422,7 +422,8 @@ public class DatabasePolicyModelsProviderTest {
databaseProvider = new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
databaseProvider.createPdpStatistics(makePdpStatisticsList());
- assertEquals(NAME, databaseProvider.getPdpStatistics(null, null).get(0).getPdpInstanceId());
+ assertEquals(NAME, databaseProvider.getFilteredPdpStatistics(PdpFilterParameters.builder().build()).get(0)
+ .getPdpInstanceId());
assertEquals(NAME, databaseProvider.getFilteredPdpStatistics(
PdpFilterParameters.builder().group(GROUP).build()).get(0).getPdpInstanceId());
assertEquals(0, databaseProvider.getFilteredPdpStatistics(
@@ -460,7 +461,7 @@ public class DatabasePolicyModelsProviderTest {
.sortOrder(ORDER).recordNum(5).build()).size());
assertEquals(NAME, databaseProvider.deletePdpStatistics(NAME, null).get(0).getPdpInstanceId());
- assertEquals(0, databaseProvider.getPdpStatistics(null, null).size());
+ assertThat(databaseProvider.getFilteredPdpStatistics(PdpFilterParameters.builder().build())).isEmpty();
assertThat(databaseProvider.getAllPolicyStatus()).isEmpty();
assertThat(databaseProvider.getAllPolicyStatus(new ToscaConceptIdentifierOptVersion("MyPolicy", null)))
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
index 224ef0e85..6cb95ee54 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
@@ -206,11 +206,6 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
}
@Override
- public List<PdpStatistics> getPdpStatistics(final String name, final Instant timestamp) throws PfModelException {
- return new ArrayList<>();
- }
-
- @Override
public List<PdpStatistics> getFilteredPdpStatistics(PdpFilterParameters filterParams) throws PfModelException {
// Not implemented
return null;
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
index d7c69bbb2..ca4c2e573 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
@@ -113,7 +113,8 @@ public class DummyPolicyModelsProviderTest {
dummyProvider.updatePdpSubGroup("name", new PdpSubGroup());
dummyProvider.updatePdp("name", "type", new Pdp());
dummyProvider.updatePdpStatistics(new ArrayList<>());
- assertTrue(dummyProvider.getPdpStatistics("name", null).isEmpty());
+ assertThat(dummyProvider.getFilteredPdpStatistics(PdpFilterParameters.builder().name("name").build()))
+ .isEmpty();
assertTrue(
dummyProvider.getFilteredPdpStatistics(