diff options
author | sunil unnava <su622b@att.com> | 2019-03-18 15:40:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-18 15:40:17 +0000 |
commit | e3da91b4013e3c4fea1d2a2c6f0e4a1677fb3ba4 (patch) | |
tree | d4645234f1bc489cedd1ab4a26f88de08c2445e7 /src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java | |
parent | 4a8983cbc2b63c24c082efd163a32aa98e2820d8 (diff) | |
parent | 2ce8d15a4d5c03bb4f2f676114c466b61c4a3188 (diff) |
Merge "Sonar fix too many method param"
Diffstat (limited to 'src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java')
-rw-r--r-- | src/main/java/org/onap/dmaap/mr/client/impl/MRBaseClient.java | 19 |
1 files changed, 10 insertions, 9 deletions
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."); } |