Merge "Sonar fix too many method param"
[dmaap/messagerouter/dmaapclient.git] / src / main / java / org / onap / dmaap / mr / client / impl / MRBaseClient.java
index 8ed7dd8..4c6d74e 100644 (file)
@@ -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.");
                }