From 86374588a6103114b1f0f335a1b65da1ad0817a5 Mon Sep 17 00:00:00 2001 From: "ning.xi" Date: Thu, 26 Dec 2019 21:37:52 +0800 Subject: update Db provider to support query number Issue-ID: POLICY-1629 Signed-off-by: ning.xi Change-Id: I42c9542adc44d52b760a70e710ab4cc6fa8a1b3b --- .../java/org/onap/policy/models/provider/PolicyModelsProvider.java | 6 ++++-- .../models/provider/impl/DatabasePolicyModelsProviderImpl.java | 5 +++-- .../policy/models/provider/impl/DummyPolicyModelsProviderImpl.java | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'models-provider/src/main') 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 2e1c71426..767a0fb6f 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 @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -364,11 +364,13 @@ public interface PolicyModelsProvider extends AutoCloseable { * @param pdpSubGroup pdpSubGroupType name to filter statistics * @param startTimeStamp startTimeStamp to filter statistics * @param endTimeStamp endTimeStamp to filter statistics + * @param sortOrder sortOrder to query database + * @param getRecordNum Total query count from database * @return the PDP statistics found * @throws PfModelException on errors getting policies */ public List getFilteredPdpStatistics(String name, @NonNull String pdpGroupName, String pdpSubGroup, - Date startTimeStamp, Date endTimeStamp) throws PfModelException; + Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) throws PfModelException; /** * Creates PDP statistics. 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 d154910bb..08c01b68f 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 @@ -337,10 +337,11 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider { @Override public List getFilteredPdpStatistics(final String name, @NonNull final String pdpGroupName, - final String pdpSubGroup, final Date startTimeStamp, final Date endTimeStamp) throws PfModelException { + final String pdpSubGroup, final Date startTimeStamp, final Date endTimeStamp, final String sortOrder, + final int getRecordNum) throws PfModelException { assertInitialized(); return new PdpStatisticsProvider().getFilteredPdpStatistics(pfDao, name, pdpGroupName, pdpSubGroup, - startTimeStamp, endTimeStamp); + startTimeStamp, endTimeStamp, sortOrder, getRecordNum); } @Override 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 c0a6e2c2a..3d1c9f61c 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 @@ -236,7 +236,7 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { @Override public List getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup, - Date startTimeStamp, Date endTimeStamp) { + Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) { // Not implemented return new ArrayList<>(); } -- cgit 1.2.3-korg