update MM agent API
Issue-ID: DMAAP-909
Change-Id: Icbc25d691f4078a24b407c33e1518e06b62141d4
Signed-off-by: sunil.unnava <su622b@att.com>
diff --git a/src/main/java/org/onap/dmaap/service/MMRestService.java b/src/main/java/org/onap/dmaap/service/MMRestService.java
index 47f5062..e271dce 100644
--- a/src/main/java/org/onap/dmaap/service/MMRestService.java
+++ b/src/main/java/org/onap/dmaap/service/MMRestService.java
@@ -538,12 +538,11 @@
}
}
- private boolean isListMirrorMaker(String msg, String messageID) {
+ public boolean isListMirrorMaker(String msg, String messageID) {
String topicmsg = msg;
topicmsg = removeExtraChar(topicmsg);
-
- JSONObject jObj;
- JSONArray jArray;
+ JSONObject jObj = new JSONObject();
+ JSONArray jArray = null;
boolean exist = false;
if (!StringUtils.isBlank(topicmsg) && topicmsg.length() > 2) {
@@ -552,11 +551,7 @@
for (int i = 0; i < jArray.length(); i++) {
jObj = jArray.getJSONObject(i);
- JSONObject obj = new JSONObject();
- if (jObj.has(MESSAGE)) {
- obj = jObj.getJSONObject(MESSAGE);
- }
- if (obj.has("messageID") && obj.get("messageID").equals(messageID) && obj.has(LISTMIRRORMAKER)) {
+ if (jObj.has("messageID") && jObj.get("messageID").equals(messageID) && jObj.has("listMirrorMaker")) {
exist = true;
break;
}