aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java
diff options
context:
space:
mode:
authorsunil unnava <su622b@att.com>2019-03-18 15:40:17 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-18 15:40:17 +0000
commite3da91b4013e3c4fea1d2a2c6f0e4a1677fb3ba4 (patch)
treed4645234f1bc489cedd1ab4a26f88de08c2445e7 /src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java
parent4a8983cbc2b63c24c082efd163a32aa98e2820d8 (diff)
parent2ce8d15a4d5c03bb4f2f676114c466b61c4a3188 (diff)
Merge "Sonar fix too many method param"
Diffstat (limited to 'src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java')
-rw-r--r--src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java34
1 files changed, 18 insertions, 16 deletions
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: "