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 --- .../mr/client/impl/MRSimplerBatchPublisher.java | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java') diff --git a/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java b/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java index c5eb3ba..4d9ab8d 100644 --- a/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java +++ b/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java @@ -352,22 +352,24 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP return true; } - if (ProtocolTypeConstants.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) { - getLog().info("sending " + fPending.size() + " msgs to " + httpurl + ". Oldest: " - + (nowMs - fPending.peek().timestamp) + " ms"); - final JSONObject result = postAuth(httpurl, baseStream.toByteArray(), contentType, authKey, authDate, - username, password, protocolFlag); - // Here we are checking for error response. If HTTP status - // code is not within the http success response code - // then we consider this as error and return false - if (result.getInt("status") < 200 || result.getInt("status") > 299) { - return false; - } - final String logLine = "MR reply ok (" + (Clock.now() - startMs) + " ms):" + result.toString(); - getLog().info(logLine); - fPending.clear(); - return true; - } + if (ProtocolTypeConstants.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) { + getLog().info("sending " + fPending.size() + " msgs to " + httpurl + ". Oldest: " + + (nowMs - fPending.peek().timestamp) + " ms"); + final JSONObject result = + postAuth(new PostAuthDataObject().setPath(httpurl).setData(baseStream.toByteArray()) + .setContentType(contentType).setAuthKey(authKey).setAuthDate(authDate) + .setUsername(username).setPassword(password).setProtocolFlag(protocolFlag)); + // Here we are checking for error response. If HTTP status + // code is not within the http success response code + // then we consider this as error and return false + if (result.getInt("status") < 200 || result.getInt("status") > 299) { + return false; + } + final String logLine = "MR reply ok (" + (Clock.now() - startMs) + " ms):" + result.toString(); + getLog().info(logLine); + fPending.clear(); + return true; + } if (ProtocolTypeConstants.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) { getLog().info("sending " + fPending.size() + " msgs to " + httpurl + ". Oldest: " -- cgit 1.2.3-korg