aboutsummaryrefslogtreecommitdiffstats
path: root/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-10-17 10:26:58 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-10-17 17:12:11 -0400
commite9b8aa0223e6f042c0533176ae8222fb061852de (patch)
treece5ac86f12a3430a688af34e5838c8be79504d12 /PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java
parent3c95fa7249cccc3d0eb3c9e89ba708a3167d41ba (diff)
Re-format source code
No longer need the onap-java-formatter.xml in the repo - just use command line to set path to it as this process is done manually anyway. Fixed missing javadoc, curly braces and variables names. One minor fix to remove redundant jump and then unnecessary lambda expression. Distance from usage - moved code. Fixed compilation error in PeCryptoUtils due to policy/common change. Fixed some test sources with consecutive capital letter in names. Updated licenses. Added some trivial code coverage. Issue-ID: POLICY-2145 Change-Id: I6c36650554e4fe31a3e71538d898535bc77e7e74 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java')
-rw-r--r--PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java39
1 files changed, 17 insertions, 22 deletions
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java
index c3fe9023f..b64d6143e 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BusConsumer.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* PolicyEngineUtils
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
* Modifications copyright (c) 2019 Nokia
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,7 @@ package org.onap.policy.utils;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Properties;
+
import org.onap.dmaap.mr.client.MRClient.MRApiException;
import org.onap.dmaap.mr.client.impl.MRConsumerImpl;
import org.onap.dmaap.mr.test.clients.ProtocolTypeConstants;
@@ -31,7 +32,7 @@ import org.onap.dmaap.mr.test.clients.ProtocolTypeConstants;
public interface BusConsumer {
/**
- * fetch messages
+ * fetch messages.
*
* @return list of messages
* @throws MRApiException when error encountered by underlying libraries
@@ -39,22 +40,22 @@ public interface BusConsumer {
Iterable<String> fetch() throws MRApiException;
/**
- * close underlying library consumer
+ * close underlying library consumer.
*/
void close();
/**
- * MR based consumer
+ * MR based consumer.
*/
class DmaapConsumerWrapper implements BusConsumer {
/**
- * MR Consumer
+ * MR Consumer.
*/
protected MRConsumerImpl consumer;
/**
- * MR Consumer Wrapper
+ * MR Consumer Wrapper.
*
* @param servers messaging bus hosts
* @param topic topic
@@ -67,15 +68,12 @@ public interface BusConsumer {
* @param fetchTimeout Fetch Timeout
* @param fetchLimit Fetch Limit
*/
- public DmaapConsumerWrapper(List<String> servers, String topic,
- String aafLogin, String aafPassword,
- String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit) throws MalformedURLException {
+ public DmaapConsumerWrapper(List<String> servers, String topic, String aafLogin, String aafPassword,
+ String consumerGroup, String consumerInstance, int fetchTimeout, int fetchLimit)
+ throws MalformedURLException {
- this(new MRConsumerImpl(servers, topic,
- consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit,
- null, aafLogin, aafPassword), aafLogin, aafPassword, servers.get(0));
+ this(new MRConsumerImpl(servers, topic, consumerGroup, consumerInstance, fetchTimeout, fetchLimit, null,
+ aafLogin, aafPassword), aafLogin, aafPassword, servers.get(0));
}
@@ -114,14 +112,11 @@ public interface BusConsumer {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
- builder.
- append("DmaapConsumerWrapper [").
- append("consumer.getAuthDate()=").append(consumer.getAuthDate()).
- append(", consumer.getAuthKey()=").append(consumer.getAuthKey()).
- append(", consumer.getHost()=").append(consumer.getHost()).
- append(", consumer.getProtocolFlag()=").append(consumer.getProtocolFlag()).
- append(", consumer.getUsername()=").append(consumer.getUsername()).
- append("]");
+ builder.append("DmaapConsumerWrapper [").append("consumer.getAuthDate()=").append(consumer.getAuthDate())
+ .append(", consumer.getAuthKey()=").append(consumer.getAuthKey()).append(", consumer.getHost()=")
+ .append(consumer.getHost()).append(", consumer.getProtocolFlag()=")
+ .append(consumer.getProtocolFlag()).append(", consumer.getUsername()=")
+ .append(consumer.getUsername()).append("]");
return builder.toString();
}
}