From 8109b02052d5a66f442d8418340ad3bd7272ff99 Mon Sep 17 00:00:00 2001 From: GuangrongFu Date: Thu, 8 Mar 2018 17:22:12 +0800 Subject: Made Fields Private Change-Id: I00ffe1aeb7e68cdfd93056fcc33c628c1c3ea63c Issue-ID: HOLMES-118 Signed-off-by: GuangrongFu --- .../main/java/org/onap/holmes/common/config/MQConfig.java | 15 +++++++++++---- .../java/org/onap/holmes/common/dmaap/DmaapService.java | 4 ++-- .../java/org/onap/holmes/common/producer/MQProducer.java | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'holmes-actions/src/main') diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java b/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java index 2ade152..70ef0cb 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java @@ -16,13 +16,20 @@ package org.onap.holmes.common.config; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor public class MQConfig { - public String brokerIp; + private String brokerIp; - public int brokerPort; + private int brokerPort; - public String brokerUsername; + private String brokerUsername; - public String brokerPassword; + private String brokerPassword; } diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java index 240f09b..c64bd59 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java @@ -38,8 +38,8 @@ public class DmaapService { @Inject private AaiQuery aaiQuery; - public static ConcurrentHashMap loopControlNames = new ConcurrentHashMap<>(); - public static ConcurrentHashMap alarmUniqueRequestID = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap loopControlNames = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap alarmUniqueRequestID = new ConcurrentHashMap<>(); public void publishPolicyMsg(PolicyMsg policyMsg, String dmaapConfigKey) { try { diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java b/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java index fd91bbd..4bbffac 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java @@ -48,9 +48,9 @@ public class MQProducer { public void init() { String brokerURL = - "tcp://" + mqConfigProvider.get().brokerIp + ":" + mqConfigProvider.get().brokerPort; - connectionFactory = new ActiveMQConnectionFactory(mqConfigProvider.get().brokerUsername, - mqConfigProvider.get().brokerPassword, brokerURL); + "tcp://" + mqConfigProvider.get().getBrokerIp() + ":" + mqConfigProvider.get().getBrokerPort(); + connectionFactory = new ActiveMQConnectionFactory(mqConfigProvider.get().getBrokerUsername(), + mqConfigProvider.get().getBrokerPassword(), brokerURL); } public void sendAlarmMQTopicMsg(VesAlarm alarm) { -- cgit 1.2.3-korg