From 2ce8d15a4d5c03bb4f2f676114c466b61c4a3188 Mon Sep 17 00:00:00 2001 From: Arindam Mondal Date: Fri, 15 Mar 2019 18:54:33 +0900 Subject: Sonar fix too many method param Issue-ID: DMAAP-1099 Change-Id: Id659edc743c76e8a56cbb39d0185bff5c50f36a3 Signed-off-by: Arindam Mondal --- .../org/onap/dmaap/mr/client/impl/MRBaseClient.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java') diff --git a/src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java b/src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java index 8ed7dd8..4c6d74e 100644 --- a/src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java +++ b/src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java @@ -160,16 +160,17 @@ public class MRBaseClient extends HttpClient implements MRClient { return responseData; } - public JSONObject postAuth(final String path, final byte[] data, final String contentType, final String authKey, - final String authDate, final String username, final String password, final String protocolFlag) + public JSONObject postAuth(PostAuthDataObject postAuthDO) throws HttpException, JSONException { - if ((null != username && null != password)) { - WebTarget target=null; - Response response=null; - target = DmaapClientUtil.getTarget(path, username, password); - response =DmaapClientUtil.postResponsewtCambriaAuth(target, authKey, authDate, data, contentType); - return getResponseDataInJson(response); - } else { + if ((null != postAuthDO.getUsername() && null != postAuthDO.getPassword())) { + WebTarget target = null; + Response response = null; + target = DmaapClientUtil.getTarget(postAuthDO.getPath(), postAuthDO.getUsername(), + postAuthDO.getPassword()); + response = DmaapClientUtil.postResponsewtCambriaAuth(target, postAuthDO.getAuthKey(), + postAuthDO.getAuthDate(), postAuthDO.getData(), postAuthDO.getContentType()); + return getResponseDataInJson(response); + } else { throw new HttpException( "Authentication Failed: Username/password/AuthKey/AuthDate parameter(s) cannot be null or empty."); } -- cgit 1.2.3-korg