aboutsummaryrefslogtreecommitdiffstats
path: root/models-pap/src/main/java/org
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2021-07-12 16:11:51 -0400
committerRam Krishna Verma <ram_krishna.verma@bell.ca>2021-07-12 16:52:16 -0400
commitcef0faf4ce34881260430f1527d6cb4342a1a7c6 (patch)
treed938ca767fd184223f4c4d18e84c24bcf2ed324a /models-pap/src/main/java/org
parent886406e003934b83da7a2b538a0574a76fd5dd4d (diff)
Add default min records for policy audit
Adding default min records as 10 for policy audit provider. This is inline with our discussions and design doumented here https://wiki.onap.org/display/DW/PAP+REST+API+changes+for+Istanbul+release Issue-ID: POLICY-3340 Change-Id: I5bab5f186f2591b1a2f2c42e9851ad88f73c8dfb Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
Diffstat (limited to 'models-pap/src/main/java/org')
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/persistence/provider/PolicyAuditProvider.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/persistence/provider/PolicyAuditProvider.java b/models-pap/src/main/java/org/onap/policy/models/pap/persistence/provider/PolicyAuditProvider.java
index 7368d29c7..ec759d34d 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/persistence/provider/PolicyAuditProvider.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/persistence/provider/PolicyAuditProvider.java
@@ -49,6 +49,7 @@ import org.onap.policy.models.pap.persistence.concepts.JpaPolicyAudit;
public class PolicyAuditProvider {
private static final Integer DEFAULT_MAX_RECORDS = 100;
+ private static final Integer DEFAULT_MIN_RECORDS = 10;
/**
* Create audit records.
@@ -79,7 +80,9 @@ public class PolicyAuditProvider {
* @return list of {@link PolicyAudit} records
*/
public List<PolicyAudit> getAuditRecords(@NonNull PfDao dao, @NonNull AuditFilter auditFilter) {
- if (auditFilter.getRecordNum() < 1 || auditFilter.getRecordNum() > DEFAULT_MAX_RECORDS) {
+ if (auditFilter.getRecordNum() < 1) {
+ auditFilter.setRecordNum(DEFAULT_MIN_RECORDS);
+ } else if (auditFilter.getRecordNum() > DEFAULT_MAX_RECORDS) {
auditFilter.setRecordNum(DEFAULT_MAX_RECORDS);
}