diff options
author | sunil.unnava <su622b@att.com> | 2019-03-20 00:25:56 -0400 |
---|---|---|
committer | sunil.unnava <su622b@att.com> | 2019-03-20 00:26:12 -0400 |
commit | 3884959f0bb9e6d0187606aa4342a80f366ca324 (patch) | |
tree | eae6e182f800a614b8e9e845fa322486621f9abf | |
parent | 0fe8e6c27fc96764731b5b2be0eb5e373f2028b4 (diff) |
update MM agent API
Issue-ID: DMAAP-909
Change-Id: Icbc25d691f4078a24b407c33e1518e06b62141d4
Signed-off-by: sunil.unnava <su622b@att.com>
-rw-r--r-- | src/main/java/org/onap/dmaap/service/MMRestService.java | 13 |
1 files changed, 4 insertions, 9 deletions
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 @@ public class MMRestService { } } - 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 @@ public class MMRestService { 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; } |