From db73ff89232054ee4e42530490cce28636f12516 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Wed, 19 Sep 2018 12:56:36 +0530 Subject: Sonar Major issues This block of commented-out lines of code should be removed Sonar Link: https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWU41WgPwGn37JfbyHtO&resolved=false&severities=MAJOR Location: src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java Line No-L174 L200 L247 Change-Id: Ia09070d3dde66fe6a506dc0b25c36fffad0e2fcd Issue-ID: DMAAP-796 Signed-off-by: Surendra Reddy Katam --- .../java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/att/dmf/mr') diff --git a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java index 837c956..539e9c0 100644 --- a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java +++ b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java @@ -171,7 +171,7 @@ public class CambriaOutboundEventStream implements StreamWriter { } // public Builder atOffset ( int pos ) - // { + // fOffset = pos; // return this; // } @@ -197,7 +197,7 @@ public class CambriaOutboundEventStream implements StreamWriter { fConsumer = builder.fConsumer; fLimit = builder.fLimit; fTimeoutMs = builder.fTimeoutMs; - // fSettings = builder.fSettings; + fSent = 0; fPretty = builder.fPretty; fWithMeta = builder.fWithMeta; @@ -244,7 +244,7 @@ public class CambriaOutboundEventStream implements StreamWriter { * @param msg * @throws IOException */ - // void onMessage(int count, Message msg) throws IOException; + void onMessage(int count, String msg, String transId, long offSet) throws IOException, JSONException; } -- cgit 1.2.3-korg From dc2d4a759e75d6780af011864aaa2157798b9306 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Wed, 19 Sep 2018 14:44:08 +0530 Subject: Sonar Major issues This block of commented-out lines of code should be removed Sonar Link: https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWU41WgPwGn37JfbyHtS&resolved=false&severities=MAJOR Location: src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java Line No-L266 L285 L302 Change-Id: I65961cf0ef580c62663c718f92af406f4490b6bf Issue-ID: DMAAP-797 Signed-off-by: Surendra Reddy Katam --- .../java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/att/dmf/mr') diff --git a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java index 539e9c0..8a5c4a9 100644 --- a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java +++ b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java @@ -263,7 +263,7 @@ public class CambriaOutboundEventStream implements StreamWriter { * throws IOException */ public void write(final OutputStream os) throws IOException { - // final boolean transactionEnabled = topic.isTransactionEnabled(); + // final boolean transactionEnabled = isTransEnabled(); // final boolean transactionEnabled = istransEnable; // synchronized(this){ @@ -282,7 +282,7 @@ public class CambriaOutboundEventStream implements StreamWriter { entry.put("message", msg); os.write(entry.toString().getBytes()); } else { - // os.write(message.getBytes()); + String jsonString = JSONObject.valueToString(msg); os.write(jsonString.getBytes()); } @@ -299,7 +299,7 @@ public class CambriaOutboundEventStream implements StreamWriter { try { if (istransEnable && istransType) { // final String transactionId = - // jsonMessage.getString("transactionId"); + // responseTransactionId = transId; StringBuilder consumerInfo = new StringBuilder(); if (null != dmaapContext && null != dmaapContext.getRequest()) { -- cgit 1.2.3-korg From f34c2b80a8b0536c2193a9b45d914b8ca5aa57a8 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Wed, 19 Sep 2018 15:07:22 +0530 Subject: Sonar Major issues This block of commented-out lines of code should be removed Sonar Link: https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWU41WgPwGn37JfbyHtV&resolved=false&severities=MAJOR Location: src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java Line No-L341 L356 L359 Change-Id: Ic7d570d6f9b5ad32608922123f642fe97a150a18 Issue-ID: DMAAP-798 Signed-off-by: Surendra Reddy Katam --- .../java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/att/dmf/mr') diff --git a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java index 8a5c4a9..fd786b7 100644 --- a/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java +++ b/src/main/java/com/att/dmf/mr/resources/CambriaOutboundEventStream.java @@ -338,7 +338,7 @@ public class CambriaOutboundEventStream implements StreamWriter { } }); - // if (null != dmaapContext && isTransactionEnabled()) { + if (null != dmaapContext && istransEnable && istransType) { dmaapContext.getResponse().setHeader("transactionId", @@ -353,10 +353,10 @@ public class CambriaOutboundEventStream implements StreamWriter { if (null != strclose_out_stream) close_out_stream = Boolean.parseBoolean(strclose_out_stream); - // if (fSettings.getBoolean("close.output.stream", true)) { + if (close_out_stream) { os.close(); - // } + } } -- cgit 1.2.3-korg