From 359458bc3a10c3969eaf62263fb6211f7bd86c13 Mon Sep 17 00:00:00 2001 From: "kris.jinka" Date: Fri, 16 Nov 2018 20:16:14 +0900 Subject: Modify decoder to use param obj Modify decoder to use param object for sonar issue fix Issue-ID: POLICY-1251 Change-Id: Iae68ba276f02be51058037b56d901a131b25838e Signed-off-by: kris.jinka --- .../drools/protocol/coders/EventProtocolCoder.java | 53 ++++++++++------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'policy-management/src/main/java/org/onap/policy/drools/protocol') diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java index b9cb568c..1afd81a3 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java +++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/coders/EventProtocolCoder.java @@ -130,23 +130,11 @@ public interface EventProtocolCoder { /** * Adds a Decoder class to decode the protocol over this topic. - * - * @param groupId of the controller - * @param artifactId of the controller - * @param topic the topic - * @param eventClass the event class - * @param protocolFilter filters to selectively choose a particular decoder - * when there are multiples - * + * + * @param eventProtocolParams parameter object for event protocol * @throw IllegalArgumentException if an invalid parameter is passed */ - public void addDecoder(String groupId, String artifactId, - String topic, - String eventClass, - JsonProtocolFilter protocolFilter, - CustomGsonCoder customGsonCoder, - CustomJacksonCoder customJacksonCoder, - int modelClassLoaderHash); + public void addDecoder(EventProtocolParams eventProtocolParams); /** * removes all decoders associated with the controller id. @@ -280,9 +268,9 @@ public interface EventProtocolCoder { /** * Adds a Encoder class to encode the protocol over this topic. - * * - * @param eventProtocolParams@throw IllegalArgumentException if an invalid parameter is passed + * @param eventProtocolParams parameter object for event protocol + * @throw IllegalArgumentException if an invalid parameter is passed */ public void addEncoder(EventProtocolParams eventProtocolParams); @@ -401,18 +389,23 @@ class MultiplexorEventProtocolCoder implements EventProtocolCoder { * {@inheritDoc}. */ @Override - public void addDecoder(String groupId, String artifactId, String topic, - String eventClass, - JsonProtocolFilter protocolFilter, - CustomGsonCoder customGsonCoder, - CustomJacksonCoder customJacksonCoder, - int modelClassLoaderHash) { - logger.info("{}: add-decoder {}:{}:{}:{}:{}:{}:{}:{}", this, - groupId, artifactId, topic, eventClass, - protocolFilter, customGsonCoder, customJacksonCoder, - modelClassLoaderHash); - this.decoders.add(groupId, artifactId, topic, eventClass, protocolFilter, - customGsonCoder, customJacksonCoder, modelClassLoaderHash); + public void addDecoder(EventProtocolParams eventProtocolParams) { + logger.info("{}: add-decoder {}:{}:{}:{}:{}:{}:{}:{}", this, + eventProtocolParams.getGroupId(), + eventProtocolParams.getArtifactId(), + eventProtocolParams.getTopic(), + eventProtocolParams.getEventClass(), + eventProtocolParams.getProtocolFilter(), + eventProtocolParams.getCustomGsonCoder(), + eventProtocolParams.getCustomJacksonCoder(), + eventProtocolParams.getModelClassLoaderHash()); + this.decoders.add(eventProtocolParams.getGroupId(), eventProtocolParams.getArtifactId(), + eventProtocolParams.getTopic(), + eventProtocolParams.getEventClass(), + eventProtocolParams.getProtocolFilter(), + eventProtocolParams.getCustomGsonCoder(), + eventProtocolParams.getCustomJacksonCoder(), + eventProtocolParams.getModelClassLoaderHash()); } /** @@ -796,7 +789,7 @@ abstract class GenericEventProtocolCoder { /** * produces key for indexing toolset entries. * - * @param group group id + * @param groupId group id * @param artifactId artifact id * @param topic topic * @return index key -- cgit 1.2.3-korg