diff options
author | sunil.unnava <su622b@att.com> | 2019-03-20 01:23:48 -0400 |
---|---|---|
committer | sunil.unnava <su622b@att.com> | 2019-03-20 01:24:30 -0400 |
commit | 8cd116bf2295fda6adbc41f87ae4d94fac572fb6 (patch) | |
tree | 5240934de61d876f9ca88a40dcf426f2456f1b7e /src/main | |
parent | 3884959f0bb9e6d0187606aa4342a80f366ca324 (diff) |
update MM agent API
Issue-ID: DMAAP-909
Change-Id: I07bbf3e2c7db7f5610511a8e8c8c3db37a74549c
Signed-off-by: sunil.unnava <su622b@att.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/service/MMRestService.java | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/src/main/java/org/onap/dmaap/service/MMRestService.java b/src/main/java/org/onap/dmaap/service/MMRestService.java index e271dce..4a2c908 100644 --- a/src/main/java/org/onap/dmaap/service/MMRestService.java +++ b/src/main/java/org/onap/dmaap/service/MMRestService.java @@ -1362,47 +1362,27 @@ public class MMRestService { } } - private String getWhitelistByNamespace(String originalWhitelist, String namespace) { - String whitelist = null; - List<String> resultList = new ArrayList<>(); - List<String> whitelistList = new ArrayList<>(); - whitelistList = Arrays.asList(originalWhitelist.split(",")); - - for (String topic : whitelistList) { - if (StringUtils.isNotBlank(originalWhitelist) && getNamespace(topic).equals(namespace)) { - resultList.add(topic); - } - } - if (!resultList.isEmpty()) { - whitelist = StringUtils.join(resultList, ","); - } - - return whitelist; - } - - private JSONArray getListMirrorMaker(String msgFrmSubscribe, String randomStr) { - JSONObject jsonObj; - JSONArray jsonArray; + public JSONArray getListMirrorMaker(String msgFrmSubscribe, String randomStr) { + JSONObject jsonObj = new JSONObject(); + JSONArray jsonArray = new JSONArray(); JSONArray listMirrorMaker = new JSONArray(); - + msgFrmSubscribe = removeExtraChar(msgFrmSubscribe); jsonArray = new JSONArray(msgFrmSubscribe); - + jsonObj = jsonArray.getJSONObject(0); + for (int i = 0; i < jsonArray.length(); i++) { jsonObj = jsonArray.getJSONObject(i); - - JSONObject obj = new JSONObject(); - if (jsonObj.has(MESSAGE)) { - obj = jsonObj.getJSONObject(MESSAGE); - } - if (obj.has("messageID") && obj.get("messageID").equals(randomStr) && obj.has(LISTMIRRORMAKER)) { - listMirrorMaker = obj.getJSONArray(LISTMIRRORMAKER); + + if (jsonObj.has("messageID") && jsonObj.get("messageID").equals(randomStr) && jsonObj.has("listMirrorMaker")) { + listMirrorMaker = jsonObj.getJSONArray("listMirrorMaker"); break; } } - return listMirrorMaker; + return listMirrorMaker; } + public JSONObject validateMMExists(DMaaPContext ctx, String name) throws Exception { // Create a listAllMirrorMaker Json object |