diff options
author | 2018-03-08 17:22:12 +0800 | |
---|---|---|
committer | 2018-03-08 17:22:12 +0800 | |
commit | 8109b02052d5a66f442d8418340ad3bd7272ff99 (patch) | |
tree | 7d1c3919bd23e0f164f936b97c491a2245bf00b1 /holmes-actions/src/main/java/org/onap | |
parent | 81304def362b19075438af781727e21ce8374bae (diff) |
Made Fields Private
Change-Id: I00ffe1aeb7e68cdfd93056fcc33c628c1c3ea63c
Issue-ID: HOLMES-118
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main/java/org/onap')
3 files changed, 16 insertions, 9 deletions
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<String, String> loopControlNames = new ConcurrentHashMap<>(); - public static ConcurrentHashMap<String, String> alarmUniqueRequestID = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap<String, String> loopControlNames = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap<String, String> 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) {
|