From e51bc733652ebd4db3b8571c5110060497e283c2 Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Fri, 10 Jul 2020 16:01:27 -0400 Subject: Changed certain external task to use the long Changed certain external task to use the long lock time. Issue-ID: SO-3049 Signed-off-by: Benjamin, Max (mb388a) Change-Id: If074ee1467fe1bac79892a885c4efddf87415b8a --- .../onap/so/utils/ExternalTaskServiceUtils.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java index 7ae7de2ece..fff82ea5bc 100644 --- a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java +++ b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java @@ -22,8 +22,16 @@ public class ExternalTaskServiceUtils { @Autowired public Environment env; - protected Set taskClients = ConcurrentHashMap.newKeySet(); + private static final long DEFAULT_LOCK_DURATION_LONG = 2700000; + private static final long DEFAULT_LOCK_DURATION_MEDIUM = 900000; + private static final long DEFAULT_LOCK_DURATION_SHORT = 300000; + + private static final String LOCK_DURATION_LONG = "mso.workflow.topics.lockDurationLong"; + private static final String LOCK_DURATION_MEDIUM = "mso.workflow.topics.lockDurationMedium"; + private static final String LOCK_DURATION_SHORT = "mso.workflow.topics.lockDurationShort"; + + protected Set taskClients = ConcurrentHashMap.newKeySet(); private static final Logger logger = LoggerFactory.getLogger(ExternalTaskServiceUtils.class); @@ -74,4 +82,16 @@ public class ExternalTaskServiceUtils { return taskClients; } + public long getLockDurationLong() { + return env.getProperty(LOCK_DURATION_LONG, Long.class, new Long(DEFAULT_LOCK_DURATION_LONG)); + } + + public long getLockDurationMedium() { + return env.getProperty(LOCK_DURATION_MEDIUM, Long.class, new Long(DEFAULT_LOCK_DURATION_MEDIUM)); + } + + public long getLockDurationShort() { + return env.getProperty(LOCK_DURATION_SHORT, Long.class, new Long(DEFAULT_LOCK_DURATION_SHORT)); + } + } -- cgit 1.2.3-korg