Sonar major issues
This block of commented-out lines of code should be removed
Sonar Link:
https://sonar.onap.org/project/issues?assignees=sumapriya&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-Vagy32hFUzlqc5sv&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
Line No:L309 L329 L340 L348
Change-Id: I7edf1c0b0e59c88d08d9a2b453f0cfb67f3e944a
Issue-ID: DMAAP-671
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
diff --git a/src/main/java/com/att/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java b/src/main/java/com/att/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
index 5b937c2..dee9e57 100644
--- a/src/main/java/com/att/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
+++ b/src/main/java/com/att/dmf/mr/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
@@ -305,8 +305,8 @@
// code from REST Client Starts
- // final String serverCalculatedSignature = sha1HmacSigner.sign
- // ("2015-09-21T11:38:19-0700", "iHAxArrj6Ve9JgmHvR077QiV");
+
+
Client client = ClientBuilder.newClient();
String metricTopicname = AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"metrics.send.cambria.topic");
@@ -323,32 +323,19 @@
Entity<byte[]> data = Entity.entity(baseStream.toByteArray(), "application/cambria");
Response response = target.request().post(data);
- // header("X-CambriaAuth",
- // "2OH46YIWa329QpEF:"+serverCalculatedSignature).
- // header("X-CambriaDate", "2015-09-21T11:38:19-0700").
- // post(Entity.json(baseStream.toByteArray()));
-
+
getLog().info("Response received :: " + response.getStatus());
getLog().info("Response received :: " + response.toString());
// code from REST Client Ends
- /*
- * final JSONObject result = post ( url, contentType,
- * baseStream.toByteArray(), true ); final String logLine =
- * "cambria reply ok (" + (Clock.now()-startMs) + " ms):" +
- * result.toString (); getLog().info ( logLine );
- */
+
fPending.clear();
return true;
} catch (IllegalArgumentException x) {
getLog().warn(x.getMessage(), x);
}
- /*
- * catch ( HttpObjectNotFoundException x ) { getLog().warn (
- * x.getMessage(), x ); } catch ( HttpException x ) { getLog().warn (
- * x.getMessage(), x ); }
- */
+
catch (IOException x) {
getLog().warn(x.getMessage(), x);
}