From 0e5f754f95c34d82a05aaceebdcad830202c7c3c Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Tue, 8 Jan 2019 11:09:09 +0530 Subject: Sonar majior 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=AWYQhtCjligbnTmNJn5l&resolved=false&severities=MAJOR Location: src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java Line No:L49 L176 L205 L268 Change-Id: I6ce7ca81e25f3c5c5f999992ff3e14eeeb198a23 Issue-ID: DMAAP-942 Signed-off-by: Surendra Reddy Katam --- .../mr/resources/CambriaOutboundEventStream.java | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java b/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java index 19e8e65..f71bda0 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/resources/CambriaOutboundEventStream.java @@ -46,15 +46,15 @@ import org.onap.dmaap.dmf.mr.utils.Utils; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; -/*import com.att.sa.highlandPark.config.HpConfigContext; -import com.att.sa.highlandPark.config.HpReaderException; -import com.att.sa.highlandPark.events.HpJsonEvent; -import com.att.sa.highlandPark.events.HpJsonEventFactory; -import com.att.sa.highlandPark.processor.HpAlarmFilter; -import com.att.sa.highlandPark.processor.HpEvent; -import com.att.sa.highlandPark.processor.HpProcessingEngine; -import com.att.sa.highlandPark.processor.HpProcessingEngine.EventFactory; -*/ + + + + + + + + + /** * class used to write the consumed messages * @@ -173,7 +173,7 @@ public class CambriaOutboundEventStream implements StreamWriter { // public Builder atOffset ( int pos ) - // return this; + // } /** * method returs object of CambriaOutboundEventStream @@ -202,26 +202,26 @@ public class CambriaOutboundEventStream implements StreamWriter { fPretty = builder.fPretty; fWithMeta = builder.fWithMeta; fKafkaConsumerList = builder.fKafkaConsumerList; - /* if (CambriaConstants.kNoFilter.equals(builder.fTopicFilter)) { - fHpAlarmFilter = null; - fHppe = null; - } else { - try { - final JSONObject filter = new JSONObject(new JSONTokener(builder.fTopicFilter)); - HpConfigContext cc = new HpConfigContext(); - fHpAlarmFilter = cc.create(HpAlarmFilter.class, filter); - final EventFactory ef = new HpJsonEventFactory(); - fHppe = new HpProcessingEngine(ef); - } catch (HpReaderException e) { - // JSON was okay, but the filter engine says it's bogus - throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, - "Couldn't create filter: " + e.getMessage()); - } catch (JSONException e) { - // user sent a bogus JSON object - throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, - "Couldn't parse JSON: " + e.getMessage()); - } - }*/ + + + + + + + + + + + + + + + + + + + + } /** @@ -265,7 +265,7 @@ public class CambriaOutboundEventStream implements StreamWriter { public void write(final OutputStream os) throws IOException { - // final boolean transactionEnabled = istransEnable; + // synchronized(this){ os.write('['); fSent = forEachMessage(new operation() { @@ -539,7 +539,7 @@ public class CambriaOutboundEventStream implements StreamWriter { private final boolean fWithMeta; private int fSent; - //private final HpProcessingEngine fHppe; + private DMaaPContext dmaapContext; private String responseTransactionId; private Topic topic; -- cgit 1.2.3-korg From 280ff3d0c54946dab3a3203d337a63e37f0aa5d0 Mon Sep 17 00:00:00 2001 From: Surendra Reddy Katam Date: Tue, 8 Jan 2019 15:11:56 +0530 Subject: Sonar majior 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=AWU41WfawGn37JfbyHsv&resolved=false&severities=MAJOR Location: src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java Line No:L191 L319 L328 L454 Change-Id: Ie4716415af32d8493b47dfd5262d06b8421ea551 Issue-ID: DMAAP-946 Signed-off-by: Surendra Reddy Katam --- .../org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java b/src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java index 3462567..800bb0f 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/utils/ConfigurationReader.java @@ -188,7 +188,7 @@ public class ConfigurationReader { log.info("Broker Type is:" + CambriaConstants.kBrokerType_Memory); fPublisher = new MemoryQueuePublisher(q, mmb); //Ramkumar remove below - // fMetaBroker = mmb; + fConsumerFactory = new MemoryConsumerFactory(q); } else { throw new IllegalArgumentException( @@ -316,18 +316,18 @@ public class ConfigurationReader { * * @return */ - /*public rrNvReadable getSettings() { - return settings; - }*/ + + + /** * method to set rrNvReadable object * * @param settings */ - /*public void setSettings(rrNvReadable settings) { - this.settings = settings; - }*/ + + + /** * method to get CuratorFramework object @@ -451,7 +451,7 @@ public class ConfigurationReader { * @return */ public static String getMainZookeeperConnectionString() { - //return settings.getString(CambriaConstants.kSetting_ZkConfigDbServers, CambriaConstants.kDefault_ZkConfigDbServers); + String zkServername = com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,CambriaConstants.kSetting_ZkConfigDbServers); if (zkServername==null) zkServername=CambriaConstants.kDefault_ZkConfigDbServers; -- cgit 1.2.3-korg