summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-04-23 13:04:59 -0400
committerJim Hahn <jrh3@att.com>2018-04-23 13:04:59 -0400
commit8e783bad73937fce1db30c246b54c282a10c642f (patch)
tree08455692444d1f5eafefda3c056b449e5e7bd6fe
parent37975da4fdeaa9bf13d3a68236d21da746e2c00e (diff)
Fix simple sonar issues in BusConsumer
Fixed simple sonar issues in policy-endpoints BusConsumer. Change-Id: I6dbcdc58bf26d62eeb6bc0357d5f859474028984 Issue-ID: POLICY-728 Signed-off-by: Jim Hahn <jrh3@att.com>
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
index a299060d..828bb920 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
@@ -263,6 +263,11 @@ public interface BusConsumer {
private static Logger logger = LoggerFactory.getLogger(DmaapConsumerWrapper.class);
/**
+ * Name of the "protocol" property.
+ */
+ protected static final String PROTOCOL_PROP = "Protocol";
+
+ /**
* fetch timeout
*/
protected int fetchTimeout;
@@ -294,7 +299,7 @@ public interface BusConsumer {
*/
public DmaapConsumerWrapper(List<String> servers, String topic, String apiKey, String apiSecret,
String username, String password, String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit, boolean useHttps) throws MalformedURLException {
+ int fetchTimeout, int fetchLimit) throws MalformedURLException {
this.fetchTimeout = fetchTimeout;
@@ -390,7 +395,7 @@ public interface BusConsumer {
throws MalformedURLException {
super(servers, topic, apiKey, apiSecret, aafLogin, aafPassword, consumerGroup,
- consumerInstance, fetchTimeout, fetchLimit, useHttps);
+ consumerInstance, fetchTimeout, fetchLimit);
// super constructor sets servers = {""} if empty to avoid errors when using DME2
if ((servers.size() == 1 && ("".equals(servers.get(0)))) || (servers == null)
@@ -403,11 +408,11 @@ public interface BusConsumer {
props = new Properties();
if (useHttps) {
- props.setProperty("Protocol", "https");
+ props.setProperty(PROTOCOL_PROP, "https");
this.consumer.setHost(servers.get(0) + ":3905");
} else {
- props.setProperty("Protocol", "http");
+ props.setProperty(PROTOCOL_PROP, "http");
this.consumer.setHost(servers.get(0) + ":3904");
}
@@ -441,7 +446,7 @@ public interface BusConsumer {
super(servers, topic, apiKey, apiSecret, dme2Login, dme2Password, consumerGroup,
- consumerInstance, fetchTimeout, fetchLimit, useHttps);
+ consumerInstance, fetchTimeout, fetchLimit);
final String dme2RouteOffer =
@@ -510,10 +515,10 @@ public interface BusConsumer {
props.setProperty("MethodType", "GET");
if (useHttps) {
- props.setProperty("Protocol", "https");
+ props.setProperty(PROTOCOL_PROP, "https");
} else {
- props.setProperty("Protocol", "http");
+ props.setProperty(PROTOCOL_PROP, "http");
}
props.setProperty("contenttype", "application/json");