Sonar Major issues
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / dmf / mr / resources / CambriaOutboundEventStream.java
index 42ca57b..0c7f8bc 100644 (file)
@@ -45,7 +45,7 @@ import com.att.dmf.mr.utils.DMaaPResponseBuilder.StreamWriter;
 import com.att.dmf.mr.utils.Utils;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
-//import com.att.nsa.drumlin.till.nv.rrNvReadable;
+
 /*import com.att.sa.highlandPark.config.HpConfigContext;
 import com.att.sa.highlandPark.config.HpReaderException;
 import com.att.sa.highlandPark.events.HpJsonEvent;
@@ -88,7 +88,7 @@ public class CambriaOutboundEventStream implements StreamWriter {
                private boolean fWithMeta;
                ArrayList<Consumer> fKafkaConsumerList;
 
-               // private int fOffset;
+               
                /**
                 * constructor it initializes all the consumer parameters
                 * 
@@ -97,15 +97,15 @@ public class CambriaOutboundEventStream implements StreamWriter {
                 */
                public Builder(Consumer c) {
                        this.fConsumer = c;
-                       // this.fSettings = settings;
+                       
 
                        fLimit = CambriaConstants.kNoTimeout;
                        fTimeoutMs = CambriaConstants.kNoLimit;
                        fTopicFilter = CambriaConstants.kNoFilter;
                        fPretty = false;
                        fWithMeta = false;
-                       //this.fKafkaConsumerList = consList;
-                       // fOffset = CambriaEvents.kNextOffset;
+                       
+       
                }
 
                /**
@@ -171,8 +171,8 @@ 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;
        }
 
@@ -263,8 +263,8 @@ 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){
                os.write('[');
@@ -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()) {
@@ -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();
-                       // }
+                       
                }
        }
 
@@ -479,10 +479,10 @@ public class CambriaOutboundEventStream implements StreamWriter {
         * 
         * Checks whether filter is initialized
         */
-       /*private boolean isFilterInitialized() {
-               return (fHpAlarmFilter != null && fHppe != null);
-       }
-*/
+       
+               
+       
+
        /**
         * 
         * @param msg
@@ -490,18 +490,18 @@ public class CambriaOutboundEventStream implements StreamWriter {
         */
        private boolean filterMatches(String msg) {
                boolean result = true;
-               /*if (isFilterInitialized()) {
-                       try {
-                               final HpJsonEvent e = new HpJsonEvent("e", new JSONObject(msg));
-                               result = fHpAlarmFilter.matches(fHppe, e);
-                       } catch (JSONException x) {
-                               // the msg may not be JSON
-                               result = false;
-                               log.error("Failed due to " + x.getMessage());
-                       } catch (Exception x) {
-                               log.error("Error using filter: " + x.getMessage(), x);
-                       }
-               }*/
+               
+               
+                               
+                               
+                       
+                       
+                       
+                               
+                       
+                               
+               
+       
 
                return result;
        }