aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-16 17:52:17 -0400
committerJim Hahn <jrh3@att.com>2020-06-17 14:41:01 -0400
commit5cfff2b468a13e7b5ce068e58e899fcfe36537b3 (patch)
tree95a3f9f64443cb7028afa90632bd412048ed05a0 /main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java
parent169dd4b89bb02a4a644b748a07a0294a324715cb (diff)
PAP should discard old PDP messages
Modified PAP to discard any messages old than 10 minutes so that if PAP is unable to communicate with DMaaP and then suddently gets flooded, it will discard old messages. Updates per review comments - made the "max message age" configurable, with a default of 10 minutes Issue-ID: POLICY-2170 Change-Id: I541c03aabf29482af12a07f51eeb5888bbafbf31 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java b/main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java
index 1776772a..72b11d76 100644
--- a/main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java
+++ b/main/src/main/java/org/onap/policy/pap/main/parameters/PdpParameters.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP PAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
package org.onap.policy.pap.main.parameters;
+import java.util.concurrent.TimeUnit;
import lombok.Getter;
import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.annotations.Min;
@@ -34,9 +35,19 @@ import org.onap.policy.common.parameters.annotations.NotNull;
@Getter
public class PdpParameters extends ParameterGroupImpl {
+ /**
+ * Default maximum message age, in milliseconds, that should be examined. Any message
+ * older than this is discarded.
+ */
+ public static final long DEFAULT_MAX_AGE_MS = TimeUnit.MILLISECONDS.convert(10, TimeUnit.MINUTES);
+
+
@Min(1)
private long heartBeatMs;
+ @Min(1)
+ private long maxMessageAgeMs = DEFAULT_MAX_AGE_MS;
+
private PdpUpdateParameters updateParameters;
private PdpStateChangeParameters stateChangeParameters;