From aedb286b0683e9ac24c5160e9d47f596a243697f Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 5 Mar 2020 16:41:15 -0500 Subject: Add other APPC-LCM operations Also added legacy ModifyConfig as an operation within APPC-LCM. Added logging to topic registration keys. Issue-ID: POLICY-2403 Signed-off-by: Jim Hahn Change-Id: Ia54a573fd6218a8afe870184b9a3baebc05b766a --- .../policy/controlloop/actorserviceprovider/topic/Forwarder.java | 7 +++++++ .../policy/controlloop/actorserviceprovider/topic/SelectorKey.java | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'models-interactions/model-actors/actorServiceProvider/src/main') diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/Forwarder.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/Forwarder.java index 2d98b66fc..957185e47 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/Forwarder.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/Forwarder.java @@ -72,6 +72,8 @@ public class Forwarder { throw new IllegalArgumentException("key/value mismatch"); } + logger.info("register topic listener for key={} value={}", keys, values); + values2listeners.compute(values, (key, listeners) -> { Map, String> map = listeners; if (map == null) { @@ -90,6 +92,8 @@ public class Forwarder { * @param listener listener to unregister */ public void unregister(List values, BiConsumer listener) { + logger.info("unregister topic listener for key={} value={}", keys, values); + values2listeners.computeIfPresent(values, (key, listeners) -> { listeners.remove(listener); return (listeners.isEmpty() ? null : listeners); @@ -112,6 +116,7 @@ public class Forwarder { * No value for this field, so this message is not relevant to this * forwarder. */ + logger.info("message has no key={}", keys); return; } @@ -122,11 +127,13 @@ public class Forwarder { Map, String> listeners = values2listeners.get(values); if (listeners == null) { // no listeners for this particular list of values + logger.info("no listener registered for key={} value={}", keys, values); return; } // forward the message to each listener + logger.info("forwarding message to listeners for key={} value={}", keys, values); for (BiConsumer listener : listeners.keySet()) { try { listener.accept(textMessage, scoMessage); diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/SelectorKey.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/SelectorKey.java index fc5727395..f1ec9e91b 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/SelectorKey.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/topic/SelectorKey.java @@ -20,6 +20,7 @@ package org.onap.policy.controlloop.actorserviceprovider.topic; +import java.util.Arrays; import lombok.EqualsAndHashCode; import org.onap.policy.common.utils.coder.StandardCoderObject; @@ -54,4 +55,9 @@ public class SelectorKey { public String extractField(StandardCoderObject object) { return object.getString(fieldIdentifiers); } + + @Override + public String toString() { + return Arrays.toString(fieldIdentifiers); + } } -- cgit 1.2.3-korg