diff options
author | ning.xi <ning.xi@est.tech> | 2019-12-26 21:37:52 +0800 |
---|---|---|
committer | ning.xi <ning.xi@est.tech> | 2020-01-08 11:15:36 +0800 |
commit | 86374588a6103114b1f0f335a1b65da1ad0817a5 (patch) | |
tree | 5256c00f48e6c145bbf670db64e7dbc9e2dbe14d /models-provider/src/main/java/org | |
parent | f69b6681486e4d1c5859f649a3293488c1859712 (diff) |
update Db provider to support query number
Issue-ID: POLICY-1629
Signed-off-by: ning.xi <ning.xi@est.tech>
Change-Id: I42c9542adc44d52b760a70e710ab4cc6fa8a1b3b
Diffstat (limited to 'models-provider/src/main/java/org')
3 files changed, 8 insertions, 5 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 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<PdpStatistics> 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<PdpStatistics> 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<PdpStatistics> getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup, - Date startTimeStamp, Date endTimeStamp) { + Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) { // Not implemented return new ArrayList<>(); } |