diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-07-11 17:54:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-11 17:54:48 +0000 |
commit | e49cefbc06e45e6d5fe1201c069c62578981f0bd (patch) | |
tree | efcce51bf18344706525483555e3bc41dd957c82 /controlloop/common/guard/src/main | |
parent | 26e713754fa52b03b0d0fd246b59db3188dd36a6 (diff) | |
parent | 0b01c65ad0f11d48020097edf3583a917adda4bf (diff) |
Merge "Include hostname as part of lock owner"
Diffstat (limited to 'controlloop/common/guard/src/main')
-rw-r--r-- | controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java index 64d8a2f74..73baf205d 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuard.java @@ -23,6 +23,7 @@ package org.onap.policy.guard; import java.util.UUID; import org.onap.policy.controlloop.policy.TargetType; import org.onap.policy.drools.core.lock.PolicyResourceLockManager; +import org.onap.policy.drools.utils.NetworkUtil; import org.onap.policy.guard.impl.PNFTargetLock; import org.onap.policy.guard.impl.VMTargetLock; import org.onap.policy.guard.impl.VNFTargetLock; @@ -209,7 +210,7 @@ public class PolicyGuard { throw new IllegalArgumentException("null requestID for lock type " + targetType); } - return targetType.toString() + ":" + requestID.toString(); + return factory.getHostname() + ":" + targetType + ":" + requestID; } /** @@ -223,5 +224,12 @@ public class PolicyGuard { public PolicyResourceLockManager getManager() { return PolicyResourceLockManager.getInstance(); } + + /** + * @return the current host name + */ + public String getHostname() { + return NetworkUtil.getHostname(); + } } } |