From 4d4547ee4b3a6be75cf2c01f3065b129fddcfd3b Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 28 Jun 2021 15:04:36 -0400 Subject: Use unique name in drools PdpMessages Also modified distributed locking to use the unique name, in case the DB is shared. Issue-ID: POLICY-3410 Change-Id: I046a9ffdcb62f3d84d7d388a1e64bcf025fbbf75 Signed-off-by: Jim Hahn --- .../distributed/locking/DistributedLockManager.java | 19 +++++++++---------- .../locking/DistributedLockManagerTest.java | 10 +++++----- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'feature-distributed-locking') diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java index c114d26a..93a63754 100644 --- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java +++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 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. @@ -41,7 +41,6 @@ import lombok.Getter; import lombok.Setter; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSourceFactory; -import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.drools.core.lock.LockCallback; import org.onap.policy.drools.core.lock.LockState; import org.onap.policy.drools.core.lock.PolicyResourceLockManager; @@ -94,7 +93,7 @@ public class DistributedLockManager extends LockManager now()")) { // @formatter:on - stmt.setString(1, hostName); + stmt.setString(1, pdpName); stmt.setString(2, uuidString); try (ResultSet resultSet = stmt.executeQuery()) { @@ -415,7 +414,7 @@ public class DistributedLockManager extends LockManager