Fixed netty & checkstyle failures 94/40094/8
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Thu, 9 Jun 2016 08:53:40 +0000 (10:53 +0200)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Thu, 9 Jun 2016 13:26:10 +0000 (15:26 +0200)
Change-Id: I5287bdcdcbc48513d45a9cd4593bf1df6c7be941
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
54 files changed:
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ConnectionInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/IdleHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetector.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslKeyStore.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/AbstractOutboundQueueManager.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoRequestMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoRequestMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketOutInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketOutInputMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/StatisticsCounters.java
openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/StatisticsCollectionModule.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DummyDecoder.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoOutputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoRequestMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ErrorMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketInMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketInMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/statistics/StatisticsCountersTest.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ListeningSimpleClient.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioHandler.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClient.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientFramer.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SleepEvent.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClient.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClientFramer.java
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/WaitForMessageEvent.java

index 4959edaa6d6c61fba60450a181a4ee4ac9fe2a85..1e95c65c48d68c2f69cc10cd25c486cb02f2184d 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2015 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.openflowjava.protocol.impl.core;
 
 /**
index e0a013c12143356545f5e8e349d9fcaef926c3f6..a0efc90073852965c07ec63ea3b771853f533120 100644 (file)
@@ -27,7 +27,7 @@ import com.google.common.base.Preconditions;
  */
 public class DelegatingInboundHandler extends ChannelInboundHandlerAdapter {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(DelegatingInboundHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DelegatingInboundHandler.class);
 
     private final MessageConsumer consumer;
     private boolean inactiveMessageSent = false;
@@ -37,7 +37,7 @@ public class DelegatingInboundHandler extends ChannelInboundHandlerAdapter {
      * @param connectionAdapter reference for adapter communicating with upper layers outside library
      */
     public DelegatingInboundHandler(final MessageConsumer connectionAdapter) {
-        LOGGER.trace("Creating DelegatingInboundHandler");
+        LOG.trace("Creating DelegatingInboundHandler");
         consumer = Preconditions.checkNotNull(connectionAdapter);
     }
 
@@ -48,7 +48,7 @@ public class DelegatingInboundHandler extends ChannelInboundHandlerAdapter {
 
     @Override
     public void channelInactive(final ChannelHandlerContext ctx) {
-        LOGGER.debug("Channel inactive");
+        LOG.debug("Channel inactive");
         if (!inactiveMessageSent) {
             DisconnectEventBuilder builder = new DisconnectEventBuilder();
             builder.setInfo("Channel inactive");
@@ -59,7 +59,7 @@ public class DelegatingInboundHandler extends ChannelInboundHandlerAdapter {
 
     @Override
     public void channelUnregistered(final ChannelHandlerContext ctx) {
-        LOGGER.debug("Channel unregistered");
+        LOG.debug("Channel unregistered");
         if (!inactiveMessageSent) {
             DisconnectEventBuilder builder = new DisconnectEventBuilder();
             builder.setInfo("Channel unregistered");
index 9b6e863def3c8d52d59c6fbf0f1b92daee8bcdba..5f408e6c6c9396073786cdef2adf78c079c6e057 100644 (file)
@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
  */
 public class IdleHandler extends ReadTimeoutHandler {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(IdleHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(IdleHandler.class);
     private boolean first = true;
 
     /**
@@ -43,7 +43,7 @@ public class IdleHandler extends ReadTimeoutHandler {
     @Override
     protected void readTimedOut(final ChannelHandlerContext ctx) throws Exception {
         if (first) {
-            LOGGER.debug("Switch idle");
+            LOG.debug("Switch idle");
             SwitchIdleEventBuilder builder = new SwitchIdleEventBuilder();
             builder.setInfo("Switch idle");
             ctx.fireChannelRead(builder.build());
index 3a083eeac410d74c943bcd3e80c8c8065e86c290..261beb9ce2564432ce9d8fc93cf3fb79b6d47964 100644 (file)
@@ -23,27 +23,27 @@ import org.slf4j.LoggerFactory;
  */
 public class OFDatagramPacketDecoder extends SimpleChannelInboundHandler<VersionMessageUdpWrapper>{
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFDatagramPacketDecoder.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketDecoder.class);
     private DeserializationFactory deserializationFactory;
 
     @Override
     public void channelRead0(final ChannelHandlerContext ctx, final VersionMessageUdpWrapper msg)
             throws Exception {
-        if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("UdpVersionMessageWrapper received");
-                LOGGER.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
+        if (LOG.isDebugEnabled()) {
+                LOG.debug("UdpVersionMessageWrapper received");
+                LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
         }
 
         try {
             final DataObject dataObject = deserializationFactory.deserialize(msg.getMessageBuffer(),msg.getVersion());
             if (dataObject == null) {
-                LOGGER.warn("Translated POJO is null");
+                LOG.warn("Translated POJO is null");
             } else {
                 MessageConsumer consumer = UdpConnectionMap.getMessageConsumer(msg.getAddress());
                 consumer.consume(dataObject);
             }
         } catch(Exception e) {
-            LOGGER.warn("Message deserialization failed", e);
+            LOG.warn("Message deserialization failed", e);
             // TODO: delegate exception to allow easier deserialization
             // debugging / deserialization problem awareness
         } finally {
index 73a7a00e11317188b70a11c244cabdc7d3b3f955..8b1faef30f33f6ee5a6eb7a51e598253467e4921 100644 (file)
@@ -28,19 +28,19 @@ import io.netty.util.concurrent.Future;
  */
 public class OFDatagramPacketEncoder extends MessageToMessageEncoder<UdpMessageListenerWrapper> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFDatagramPacketEncoder.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketEncoder.class);
     private SerializationFactory serializationFactory;
 
     @Override
     protected void encode(ChannelHandlerContext ctx,
             UdpMessageListenerWrapper wrapper, List<Object> out) throws Exception {
-        LOGGER.trace("Encoding");
+        LOG.trace("Encoding");
         try {
             ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
             serializationFactory.messageToBuffer(wrapper.getMsg().getVersion(), buffer, wrapper.getMsg());
             out.add(new DatagramPacket(buffer, wrapper.getAddress()));
         } catch(Exception e) {
-            LOGGER.warn("Message serialization failed: {}", e.getMessage());
+            LOG.warn("Message serialization failed: {}", e.getMessage());
             Future<Void> newFailedFuture = ctx.newFailedFuture(e);
             wrapper.getListener().operationComplete(newFailedFuture);
             return;
index 16068a5e18c9e68a23258dd715b8a3c98f6e9b8a..0eb2916165f2e29ca5ab07e6321d5483d7b74a11 100644 (file)
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
  */
 public class OFDatagramPacketHandler extends MessageToMessageDecoder<DatagramPacket> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFDatagramPacketHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketHandler.class);
 
     /** Length of OpenFlow 1.3 header */
     public static final byte LENGTH_OF_HEADER = 8;
@@ -50,15 +50,15 @@ public class OFDatagramPacketHandler extends MessageToMessageDecoder<DatagramPac
 
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-        LOGGER.warn("Unexpected exception from downstream.", cause);
-        LOGGER.warn("Closing connection.");
+        LOG.warn("Unexpected exception from downstream.", cause);
+        LOG.warn("Closing connection.");
         ctx.close();
     }
 
     @Override
     protected void decode(ChannelHandlerContext ctx, DatagramPacket msg,
             List<Object> out) throws Exception {
-        LOGGER.debug("OFDatagramPacketFramer");
+        LOG.debug("OFDatagramPacketFramer");
         MessageConsumer consumer = UdpConnectionMap.getMessageConsumer(msg.sender());
         if (consumer == null) {
             ConnectionFacade connectionFacade =
@@ -70,34 +70,34 @@ public class OFDatagramPacketHandler extends MessageToMessageDecoder<DatagramPac
         ByteBuf bb = msg.content();
         int readableBytes = bb.readableBytes();
         if (readableBytes < LENGTH_OF_HEADER) {
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("skipping bytebuf - too few bytes for header: {} < {}", readableBytes, LENGTH_OF_HEADER);
-                LOGGER.debug("bb: {}", ByteBufUtils.byteBufToHexString(bb));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("skipping bytebuf - too few bytes for header: {} < {}", readableBytes, LENGTH_OF_HEADER);
+                LOG.debug("bb: {}", ByteBufUtils.byteBufToHexString(bb));
             }
             return;
         }
 
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
-        LOGGER.debug("length of actual message: {}", length);
+        LOG.debug("length of actual message: {}", length);
 
         if (readableBytes < length) {
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("skipping bytebuf - too few bytes for msg: {} < {}", readableBytes, length);
-                LOGGER.debug("bytebuffer: {}", ByteBufUtils.byteBufToHexString(bb));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("skipping bytebuf - too few bytes for msg: {} < {}", readableBytes, length);
+                LOG.debug("bytebuffer: {}", ByteBufUtils.byteBufToHexString(bb));
             }
             return;
         }
-        LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
+        LOG.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
 
 
         byte version = bb.readByte();
         if ((version == EncodeConstants.OF13_VERSION_ID) || (version == EncodeConstants.OF10_VERSION_ID)) {
-            LOGGER.debug("detected version: {}", version);
+            LOG.debug("detected version: {}", version);
             ByteBuf messageBuffer = bb.slice();
             out.add(new VersionMessageUdpWrapper(version, messageBuffer, msg.sender()));
             messageBuffer.retain();
         } else {
-            LOGGER.warn("detected version: {} - currently not supported", version);
+            LOG.warn("detected version: {} - currently not supported", version);
         }
         bb.skipBytes(bb.readableBytes());
     }
index de419f8b005e8d82e8507498ae9c5c525b797eee..ec1f43d329e1efa23ea0171607fcaf63642a4319 100644 (file)
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
  */
 public class OFDecoder extends MessageToMessageDecoder<VersionMessageWrapper> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFDecoder.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFDecoder.class);
     private final StatisticsCounters statisticsCounter;
 
     // TODO: make this final?
@@ -37,7 +37,7 @@ public class OFDecoder extends MessageToMessageDecoder<VersionMessageWrapper> {
      * Constructor of class
      */
     public OFDecoder() {
-        LOGGER.trace("Creating OF 1.3 Decoder");
+        LOG.trace("Creating OF 1.3 Decoder");
        // TODO: pass as argument
         statisticsCounter = StatisticsCounters.getInstance();
     }
@@ -46,23 +46,23 @@ public class OFDecoder extends MessageToMessageDecoder<VersionMessageWrapper> {
     protected void decode(ChannelHandlerContext ctx, VersionMessageWrapper msg,
             List<Object> out) throws Exception {
         statisticsCounter.incrementCounter(CounterEventTypes.US_RECEIVED_IN_OFJAVA);
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug("VersionMessageWrapper received");
-            LOGGER.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("VersionMessageWrapper received");
+            LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
         }
 
         try {
             final DataObject dataObject = deserializationFactory.deserialize(msg.getMessageBuffer(),
                     msg.getVersion());
             if (dataObject == null) {
-                LOGGER.warn("Translated POJO is null");
+                LOG.warn("Translated POJO is null");
                 statisticsCounter.incrementCounter(CounterEventTypes.US_DECODE_FAIL);
             } else {
                 out.add(dataObject);
                 statisticsCounter.incrementCounter(CounterEventTypes.US_DECODE_SUCCESS);
             }
         } catch (Exception e) {
-            LOGGER.warn("Message deserialization failed", e);
+            LOG.warn("Message deserialization failed", e);
             statisticsCounter.incrementCounter(CounterEventTypes.US_DECODE_FAIL);
         } finally {
             msg.getMessageBuffer().release();
index f4ec88255fc180dd3784cc118d2550acc83eab6b..735070fa0c0017684b6d37c95207446d5b3a2d06 100644 (file)
@@ -29,7 +29,7 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
     /** Length of OpenFlow 1.3 header */
     public static final byte LENGTH_OF_HEADER = 8;
     private static final byte LENGTH_INDEX_IN_HEADER = 2;
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFFrameDecoder.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFFrameDecoder.class);
     private ConnectionFacade connectionFacade;
     private boolean firstTlsPass = false;
 
@@ -40,7 +40,7 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
      * @param tlsPresent true is TLS is required, false otherwise
      */
     public OFFrameDecoder(ConnectionFacade connectionFacade, boolean tlsPresent) {
-        LOGGER.trace("Creating OFFrameDecoder");
+        LOG.trace("Creating OFFrameDecoder");
         if (tlsPresent) {
             firstTlsPass = true;
         }
@@ -50,11 +50,11 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
         if (cause instanceof io.netty.handler.ssl.NotSslRecordException) {
-            LOGGER.warn("Not an TLS record exception - please verify TLS configuration.");
+            LOG.warn("Not an TLS record exception - please verify TLS configuration.");
         } else {
-            LOGGER.warn("Unexpected exception from downstream.", cause);
+            LOG.warn("Unexpected exception from downstream.", cause);
         }
-        LOGGER.warn("Closing connection.");
+        LOG.warn("Closing connection.");
         ctx.close();
     }
 
@@ -66,24 +66,24 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
         }
         int readableBytes = bb.readableBytes();
         if (readableBytes < LENGTH_OF_HEADER) {
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("skipping bytebuf - too few bytes for header: {} < {}", readableBytes, LENGTH_OF_HEADER);
-                LOGGER.debug("bb: {}", ByteBufUtils.byteBufToHexString(bb));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("skipping bytebuf - too few bytes for header: {} < {}", readableBytes, LENGTH_OF_HEADER);
+                LOG.debug("bb: {}", ByteBufUtils.byteBufToHexString(bb));
             }
             return;
         }
 
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
-        LOGGER.debug("length of actual message: {}", length);
+        LOG.debug("length of actual message: {}", length);
 
         if (readableBytes < length) {
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("skipping bytebuf - too few bytes for msg: {} < {}", readableBytes, length);
-                LOGGER.debug("bytebuffer: {}", ByteBufUtils.byteBufToHexString(bb));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("skipping bytebuf - too few bytes for msg: {} < {}", readableBytes, length);
+                LOG.debug("bytebuffer: {}", ByteBufUtils.byteBufToHexString(bb));
             }
             return;
         }
-        LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
+        LOG.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
 
         ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
         list.add(messageBuffer);
index 0142ebfd671634a89b6604369c201c7fab55a6c0..b635ef2567610076a3b982db2dfb688ed387f209 100644 (file)
@@ -29,7 +29,7 @@ public class OFVersionDetector extends ByteToMessageDecoder {
     /** Version number of OpenFlow 1.3 protocol */
     private static final byte OF13_VERSION_ID = EncodeConstants.OF13_VERSION_ID;
     private static final short OF_PACKETIN = 10;
-    private static final Logger LOGGER = LoggerFactory.getLogger(OFVersionDetector.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OFVersionDetector.class);
     private final StatisticsCounters statisticsCounters;
     private volatile boolean filterPacketIns;
 
@@ -37,7 +37,7 @@ public class OFVersionDetector extends ByteToMessageDecoder {
      * Constructor of class.
      */
     public OFVersionDetector() {
-        LOGGER.trace("Creating OFVersionDetector");
+        LOG.trace("Creating OFVersionDetector");
         statisticsCounters = StatisticsCounters.getInstance();
     }
 
@@ -48,24 +48,24 @@ public class OFVersionDetector extends ByteToMessageDecoder {
     @Override
     protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
         if (!in.isReadable()) {
-            LOGGER.debug("not enough data");
+            LOG.debug("not enough data");
             in.release();
             return;
         }
 
         final byte version = in.readByte();
         if (version == OF13_VERSION_ID || version == OF10_VERSION_ID) {
-            LOGGER.debug("detected version: {}", version);
+            LOG.debug("detected version: {}", version);
             if (!filterPacketIns || OF_PACKETIN != in.getUnsignedByte(in.readerIndex())) {
                 ByteBuf messageBuffer = in.slice();
                 out.add(new VersionMessageWrapper(version, messageBuffer));
                 messageBuffer.retain();
             } else {
-                LOGGER.debug("dropped packetin");
+                LOG.debug("dropped packetin");
                 statisticsCounters.incrementCounter(CounterEventTypes.US_DROPPED_PACKET_IN);
             }
         } else {
-            LOGGER.warn("detected version: {} - currently not supported", version);
+            LOG.warn("detected version: {} - currently not supported", version);
         }
         in.skipBytes(in.readableBytes());
     }
index b2c5a199f53d9f2da23c873d6fc1a2ede6f6db5c..dbaa207022892125cd4167d2705a9723a259ea4b 100644 (file)
@@ -34,7 +34,7 @@ public class SslContextFactory {
     private static final String PROTOCOL = "TLS";
     private TlsConfiguration tlsConfig;
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(SslContextFactory.class);
 
     /**
@@ -72,16 +72,16 @@ public class SslContextFactory {
             serverContext = SSLContext.getInstance(PROTOCOL);
             serverContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
         } catch (IOException e) {
-            LOGGER.warn("IOException - Failed to load keystore / truststore."
+            LOG.warn("IOException - Failed to load keystore / truststore."
                     + " Failed to initialize the server-side SSLContext", e);
         } catch (NoSuchAlgorithmException e) {
-            LOGGER.warn("NoSuchAlgorithmException - Unsupported algorithm."
+            LOG.warn("NoSuchAlgorithmException - Unsupported algorithm."
                     + " Failed to initialize the server-side SSLContext", e);
         } catch (CertificateException e) {
-            LOGGER.warn("CertificateException - Unable to access certificate (check password)."
+            LOG.warn("CertificateException - Unable to access certificate (check password)."
                     + " Failed to initialize the server-side SSLContext", e);
         } catch (Exception e) {
-            LOGGER.warn("Exception - Failed to initialize the server-side SSLContext", e);
+            LOG.warn("Exception - Failed to initialize the server-side SSLContext", e);
         }
         return serverContext;
     }
index 589c23cd33d8833375779570a0621e3a98073837..e4efea9f765dcfdcfc58cc46537148cba747b863 100644 (file)
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
  */
 public final class SslKeyStore {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(SslKeyStore.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SslKeyStore.class);
 
     private SslKeyStore() {
         throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
@@ -48,7 +48,7 @@ public final class SslKeyStore {
             }
             break;
         case PATH:
-            LOGGER.debug("Current dir using System:"
+            LOG.debug("Current dir using System:"
                     + System.getProperty("user.dir"));
             File keystorefile = new File(filename);
             try {
index 411a9b4323e30dad162749c8c277799cf7dee777..bb327361a60149256f0c1ae738cb9b3a28b0e370 100644 (file)
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
  */
 public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, ConnectionInitializer {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(SwitchConnectionProviderImpl.class);
     private SwitchConnectionHandler switchConnectionHandler;
     private ServerFacade serverFacade;
@@ -88,15 +88,15 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C
 
     @Override
     public void setSwitchConnectionHandler(final SwitchConnectionHandler switchConnectionHandler) {
-        LOGGER.debug("setSwitchConnectionHandler");
+        LOG.debug("setSwitchConnectionHandler");
         this.switchConnectionHandler = switchConnectionHandler;
     }
 
     @Override
     public ListenableFuture<Boolean> shutdown() {
-        LOGGER.debug("Shutdown summoned");
+        LOG.debug("Shutdown summoned");
         if(serverFacade == null){
-            LOGGER.warn("Can not shutdown - not configured or started");
+            LOG.warn("Can not shutdown - not configured or started");
             throw new IllegalStateException("SwitchConnectionProvider is not started or not configured.");
         }
         return serverFacade.shutdown();
@@ -104,7 +104,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C
 
     @Override
     public ListenableFuture<Boolean> startup() {
-        LOGGER.debug("Startup summoned");
+        LOG.debug("Startup summoned");
         ListenableFuture<Boolean> result = null;
         try {
             serverFacade = createAndConfigureServer();
@@ -125,7 +125,7 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider, C
      * @return
      */
     private ServerFacade createAndConfigureServer() {
-        LOGGER.debug("Configuring ..");
+        LOG.debug("Configuring ..");
         ServerFacade server = null;
         final ChannelInitializerFactory factory = new ChannelInitializerFactory();
         factory.setSwitchConnectionHandler(switchConnectionHandler);
index 881f697adf85d0f8cdf50ec12844723688c9af46..376978d1c4e392eb9069fb50ba50422c7c1b807d 100644 (file)
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
  */
 public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChannel> {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(TcpChannelInitializer.class);
     private final DefaultChannelGroup allChannels;
     private final ConnectionAdapterFactory connectionAdapterFactory;
@@ -58,21 +58,21 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
             final InetAddress switchAddress = ch.remoteAddress().getAddress();
             final int port = ch.localAddress().getPort();
             final int remotePort = ch.remoteAddress().getPort();
-            LOGGER.debug("Incoming connection from (remote address): {}:{} --> :{}",
+            LOG.debug("Incoming connection from (remote address): {}:{} --> :{}",
                            switchAddress.toString(), remotePort, port);
 
             if (!getSwitchConnectionHandler().accept(switchAddress)) {
                 ch.disconnect();
-                LOGGER.debug("Incoming connection rejected");
+                LOG.debug("Incoming connection rejected");
                 return;
             }
         }
-        LOGGER.debug("Incoming connection accepted - building pipeline");
+        LOG.debug("Incoming connection accepted - building pipeline");
         allChannels.add(ch);
         ConnectionFacade connectionFacade = null;
         connectionFacade = connectionAdapterFactory.createConnectionFacade(ch, null, useBarrier());
         try {
-            LOGGER.debug("calling plugin: {}", getSwitchConnectionHandler());
+            LOG.debug("calling plugin: {}", getSwitchConnectionHandler());
             getSwitchConnectionHandler().onSwitchConnected(connectionFacade);
             connectionFacade.checkListeners();
             ch.pipeline().addLast(PipelineHandlers.IDLE_HANDLER.name(), new IdleHandler(getSwitchIdleTimeout(), TimeUnit.MILLISECONDS));
@@ -87,10 +87,10 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
                 engine.setUseClientMode(false);
                 List<String> suitesList = getTlsConfiguration().getCipherSuites();
                 if (suitesList != null && !suitesList.isEmpty()) {
-                    LOGGER.debug("Requested Cipher Suites are: {}", suitesList);
+                    LOG.debug("Requested Cipher Suites are: {}", suitesList);
                     String[] suites = suitesList.toArray(new String[suitesList.size()]);
                     engine.setEnabledCipherSuites(suites);
-                    LOGGER.debug("Cipher suites enabled in SSLEngine are: {}", engine.getEnabledCipherSuites().toString());
+                    LOG.debug("Cipher suites enabled in SSLEngine are: {}", engine.getEnabledCipherSuites().toString());
                 }
                 final SslHandler ssl = new SslHandler(engine);
                 final Future<Channel> handshakeFuture = ssl.handshakeFuture();
@@ -117,7 +117,7 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
                 connectionFacade.fireConnectionReadyNotification();
             }
         } catch (final Exception e) {
-            LOGGER.warn("Failed to initialize channel", e);
+            LOG.warn("Failed to initialize channel", e);
             ch.close();
         }
     }
index c5905d60800f0908297a21442a6016a2d2230a22..d0a2fc63578fb79bbba2886c0f190a1bbb2aa98d 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2015 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.openflowjava.protocol.impl.core;
 
 import io.netty.bootstrap.Bootstrap;
@@ -20,7 +28,7 @@ import com.google.common.util.concurrent.SettableFuture;
 public class TcpConnectionInitializer implements ServerFacade,
         ConnectionInitializer {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(TcpConnectionInitializer.class);
     private EventLoopGroup workerGroup;
     private ThreadConfiguration threadConfig;
@@ -73,7 +81,7 @@ public class TcpConnectionInitializer implements ServerFacade,
         try {
             b.connect(host, port).sync();
         } catch (InterruptedException e) {
-            LOGGER.error("Unable to initiate connection", e);
+            LOG.error("Unable to initiate connection", e);
         }
     }
 
index 00a3fd71ffde83727681c96326523f3c28495208..2391423103a6974864a51062c45a8b6878dd98e3 100644 (file)
@@ -51,7 +51,7 @@ public class TcpHandler implements ServerFacade {
      */
     private static final int DEFAULT_WRITE_SPIN_COUNT = 16;
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(TcpHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(TcpHandler.class);
 
     private int port;
     private String address;
@@ -122,7 +122,7 @@ public class TcpHandler implements ServerFacade {
                 f = b.bind(port).sync();
             }
         } catch (InterruptedException e) {
-            LOGGER.error("Interrupted while binding port {}", port, e);
+            LOG.error("Interrupted while binding port {}", port, e);
             return;
         }
 
@@ -133,12 +133,12 @@ public class TcpHandler implements ServerFacade {
             // Update port, as it may have been specified as 0
             this.port = isa.getPort();
 
-            LOGGER.debug("address from tcphandler: {}", address);
+            LOG.debug("address from tcphandler: {}", address);
             isOnlineFuture.set(true);
-            LOGGER.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port);
+            LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port);
             f.channel().closeFuture().sync();
         } catch (InterruptedException e) {
-            LOGGER.error("Interrupted while waiting for port {} shutdown", port, e);
+            LOG.error("Interrupted while waiting for port {} shutdown", port, e);
         } finally {
             shutdown();
         }
@@ -252,7 +252,7 @@ public class TcpHandler implements ServerFacade {
             ((EpollEventLoopGroup)workerGroup).setIoRatio(100);
             return;
         } catch (Throwable ex) {
-            LOGGER.debug("Epoll initiation failed");
+            LOG.debug("Epoll initiation failed");
         }
 
         //Fallback mechanism
index 9339ba1664f7781a914f33f5ed0becb84edf562c..1dac7a593f6eb2414ad17fe7d5b4b3267bb27e38 100644 (file)
@@ -36,7 +36,7 @@ import com.google.common.util.concurrent.SettableFuture;
  */
 public final class UdpHandler implements ServerFacade {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(UdpHandler.class);
     private int port;
     private EventLoopGroup group;
@@ -82,7 +82,7 @@ public final class UdpHandler implements ServerFacade {
                 f = b.bind(port).sync();
             }
         } catch (InterruptedException e) {
-            LOGGER.error("Interrupted while binding port {}", port, e);
+            LOG.error("Interrupted while binding port {}", port, e);
             return;
         }
 
@@ -93,12 +93,12 @@ public final class UdpHandler implements ServerFacade {
             // Update port, as it may have been specified as 0
             this.port = isa.getPort();
 
-            LOGGER.debug("Address from udpHandler: {}", address);
+            LOG.debug("Address from udpHandler: {}", address);
             isOnlineFuture.set(true);
-            LOGGER.info("Switch listener started and ready to accept incoming udp connections on port: {}", port);
+            LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port);
             f.channel().closeFuture().sync();
         } catch (InterruptedException e) {
-            LOGGER.error("Interrupted while waiting for port {} shutdown", port, e);
+            LOG.error("Interrupted while waiting for port {} shutdown", port, e);
         } finally {
             shutdown();
         }
@@ -186,7 +186,7 @@ public final class UdpHandler implements ServerFacade {
             }
             return;
         } catch (Throwable ex) {
-            LOGGER.debug("Epoll initiation failed");
+            LOG.debug("Epoll initiation failed");
         }
 
         //Fallback mechanism
index 64063943b5dfa8c192df08e3a863ce2d2c758714..34df0170b4f34692f9225f757585d0ffbf846613 100644 (file)
@@ -279,12 +279,12 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
     /* NPE are coming from {@link OFEncoder#encode} from catch block and we don't wish to lost it */
     private static final GenericFutureListener<Future<Void>> LOG_ENCODER_LISTENER = new GenericFutureListener<Future<Void>>() {
 
-        private final Logger LOGGER = LoggerFactory.getLogger("LogEncoderListener");
+        private final Logger LOG = LoggerFactory.getLogger(GenericFutureListener.class);
 
         @Override
         public void operationComplete(final Future<Void> future) throws Exception {
             if (future.cause() != null) {
-                LOGGER.warn("Message encoding fail !", future.cause());
+                LOG.warn("Message encoding fail !", future.cause());
             }
         }
     };
index 6ee4818344ec655ab57480897d63a3ff1b5af383..7ba0f2c393ef78127f4fa8bf2a95ec30ac60930c 100644 (file)
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
  */
 public class DeserializerRegistryImpl implements DeserializerRegistry {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(DeserializerRegistryImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DeserializerRegistryImpl.class);
     private Map<MessageCodeKey, OFGeneralDeserializer> registry;
 
     /**
@@ -79,7 +79,7 @@ public class DeserializerRegistryImpl implements DeserializerRegistry {
         }
         OFGeneralDeserializer desInRegistry = registry.put(key, deserializer);
         if (desInRegistry != null) {
-            LOGGER.debug("Deserializer for key {} overwritten. Old deserializer: {}, new deserializer: {}", key,
+            LOG.debug("Deserializer for key {} overwritten. Old deserializer: {}, new deserializer: {}", key,
                     desInRegistry.getClass().getName(), deserializer.getClass().getName());
         }
         if (deserializer instanceof DeserializerRegistryInjector) {
index 8c8ba38963d30e1c30b425ccc7d5a9c1ea18703d..5d3ecde73db018484c644e5c02a61d6786f9f905 100644 (file)
@@ -29,7 +29,9 @@ public class EchoReplyMessageFactory implements OFDeserializer<EchoOutput> {
         builder.setXid(rawMessage.readUnsignedInt());
         int remainingBytes = rawMessage.readableBytes();
         if (remainingBytes > 0) {
-            builder.setData(rawMessage.readBytes(remainingBytes).array());
+            byte[] data = new byte[remainingBytes];
+            rawMessage.readBytes(data);
+            builder.setData(data);
         }
         return builder.build();
     }
index 6e1e55974aa8cacfb888775c8c639d9d65b60b0d..446faf1441a2f7a112410ebc473fb36534f5a8ff 100644 (file)
@@ -27,7 +27,9 @@ public class EchoRequestMessageFactory implements OFDeserializer<EchoRequestMess
         EchoRequestMessageBuilder builder = new EchoRequestMessageBuilder();
         builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
         builder.setXid(rawMessage.readUnsignedInt());
-        builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
+        byte[] data = new byte[rawMessage.readableBytes()];
+        rawMessage.readBytes(data);
+        builder.setData(data);
         return builder.build();
     }
 }
index daae36346d58ea860967695a699cba89ede61775..b11da58c36f321eb2063f6e4c49d9dbc0beb4ae4 100644 (file)
@@ -63,8 +63,11 @@ public class ErrorMessageFactory implements OFDeserializer<ErrorMessage>,
         }
         decodeType(builder, errorType, type);
         decodeCode(rawMessage, builder, errorType);
-        if (rawMessage.readableBytes() > 0) {
-            builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
+        int remainingBytes = rawMessage.readableBytes();
+        if (remainingBytes > 0) {
+            byte[] data = new byte[remainingBytes];
+            rawMessage.readBytes(data);
+            builder.setData(data);
         }
         return builder.build();
     }
index ec45475e33f02b1809230ad0e65b2f19c303a24e..107faa5a3f48e00a9ddabd0b5e1f3e4a48a23b02 100644 (file)
@@ -29,7 +29,9 @@ public class OF10EchoReplyMessageFactory implements OFDeserializer<EchoOutput> {
         builder.setXid(rawMessage.readUnsignedInt());
         int remainingBytes = rawMessage.readableBytes();
         if (remainingBytes > 0) {
-            builder.setData(rawMessage.readBytes(remainingBytes).array());
+            byte[] data = new byte[remainingBytes];
+            rawMessage.readBytes(data);
+            builder.setData(data);
         }
         return builder.build();
     }
index a63c255d3c42a470bb77e8652d0c6ef86c2442fb..a90044ca99c1b38775bf959fc4f58889d500ed88 100644 (file)
@@ -27,7 +27,9 @@ public class OF10EchoRequestMessageFactory implements OFDeserializer<EchoRequest
         EchoRequestMessageBuilder builder = new EchoRequestMessageBuilder();
         builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
         builder.setXid(rawMessage.readUnsignedInt());
-        builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
+        byte[] data = new byte[rawMessage.readableBytes()];
+        rawMessage.readBytes(data);
+        builder.setData(data);
         return builder.build();
     }
 }
index db7376e643e398c24441f5de8197cffd4134b79a..aa8b9c8d535b0f9838b53663c562e5317fa37f85 100644 (file)
@@ -40,8 +40,11 @@ public class OF10ErrorMessageFactory implements OFDeserializer<ErrorMessage> {
         ErrorTypeV10 errorType = ErrorTypeV10.forValue(type);
         decodeType(builder, errorType, type);
         decodeCode(rawMessage, builder, errorType);
-        if (rawMessage.readableBytes() > 0) {
-            builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
+        int remainingBytes = rawMessage.readableBytes();
+        if (remainingBytes > 0) {
+            byte[] data = new byte[remainingBytes];
+            rawMessage.readBytes(data);
+            builder.setData(data);
         }
         return builder.build();
     }
index 1f4d2c1e760e6b4257853f4b0a1b49ddc607f191..94cce9b1d04e78f20e40f66cb94399350ba25900 100644 (file)
@@ -47,7 +47,8 @@ public class OF10PacketOutInputMessageFactory implements OFDeserializer<PacketOu
                 rawMessage, keyMaker, registry);
         builder.setAction(actions);
 
-        byte[] data = rawMessage.readBytes(rawMessage.readableBytes()).array();
+        byte[] data = new byte[rawMessage.readableBytes()];
+        rawMessage.readBytes(data);
 
         if (data != null) {
 
index 44679569d44ec2eaef87abfd0626b37feb8901c4..a69baeea9164cde1d4e26915529341335a9851d0 100644 (file)
@@ -51,7 +51,9 @@ public class PacketInMessageFactory implements OFDeserializer<PacketInMessage>,
         OFDeserializer<Match> matchDeserializer = registry.getDeserializer(MATCH_KEY);
         builder.setMatch(matchDeserializer.deserialize(rawMessage));
         rawMessage.skipBytes(PADDING_IN_PACKET_IN_HEADER);
-        builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
+        byte[] data = new byte[rawMessage.readableBytes()];
+        rawMessage.readBytes(data);
+        builder.setData(data);
         return builder.build();
     }
 
index 6b1ddc94d041fba93059001e9d77a8eaddd02c9d..919a8e7401f19697bdf221633689223bc5ecb4f8 100644 (file)
@@ -38,7 +38,8 @@ public class PacketOutInputMessageFactory implements OFDeserializer<PacketOutInp
         List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, actions_len,
                 rawMessage, keyMaker, registry);
         builder.setAction(actions);
-        byte[] data = rawMessage.readBytes(rawMessage.readableBytes()).array();
+        byte[] data = new byte[rawMessage.readableBytes()];
+        rawMessage.readBytes(data);
         if (data != null) {
             builder.setData(data);
         }
index 96307fa2c2aaceb8e9389cea4845bd703bd59176..9383187866dfa5608bdffad335ab332c9971356a 100644 (file)
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
  */
 public class SerializerRegistryImpl implements SerializerRegistry {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(SerializerRegistryImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SerializerRegistryImpl.class);
     private static final short OF10 = EncodeConstants.OF10_VERSION_ID;
     private static final short OF13 = EncodeConstants.OF13_VERSION_ID;
     private Map<MessageTypeKey<?>, OFGeneralSerializer> registry;
@@ -83,7 +83,7 @@ public class SerializerRegistryImpl implements SerializerRegistry {
         }
         OFGeneralSerializer serInRegistry = registry.put(msgTypeKey, serializer);
         if (serInRegistry != null) {
-            LOGGER.debug("Serializer for key {} overwritten. Old serializer: {}, new serializer: {}", msgTypeKey,
+            LOG.debug("Serializer for key {} overwritten. Old serializer: {}, new serializer: {}", msgTypeKey,
                     serInRegistry.getClass().getName(), serializer.getClass().getName());
         }
         if (serializer instanceof SerializerRegistryInjector) {
index 32ecb5de7f058c174b81d2129e7c693625e14625..7022c98d5541ef25ce853587d36d1750b922378c 100644 (file)
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
  * @author timotej.kubas
  */
 public class OF13MatchSerializer implements OFSerializer<Match>, SerializerRegistryInjector {
-    private static final Logger LOGGER = LoggerFactory.getLogger(OF13MatchSerializer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OF13MatchSerializer.class);
     private static final byte STANDARD_MATCH_TYPE_CODE = 0;
     private static final byte OXM_MATCH_TYPE_CODE = 1;
     private SerializerRegistry registry;
@@ -40,7 +40,7 @@ public class OF13MatchSerializer implements OFSerializer<Match>, SerializerRegis
     @Override
     public void serialize(Match match, ByteBuf outBuffer) {
         if (match == null) {
-            LOGGER.debug("Match is null");
+            LOG.debug("Match is null");
             return;
         }
         int matchStartIndex = outBuffer.writerIndex();
@@ -72,7 +72,7 @@ public class OF13MatchSerializer implements OFSerializer<Match>, SerializerRegis
      */
     public void serializeMatchEntries(List<MatchEntry> matchEntries, ByteBuf out) {
         if (matchEntries == null) {
-            LOGGER.debug("Match entries are null");
+            LOG.debug("Match entries are null");
             return;
         }
         for (MatchEntry entry : matchEntries) {
index 3f900d806bd37fe8e3ba3bfa87f498f8d4d65666..d0c071e50f8d3b7eb6f909a3ea09f1d7bea0d66c 100644 (file)
@@ -31,7 +31,7 @@ public final class StatisticsCounters implements StatisticsHandler {
      */
     public static final int MINIMAL_LOG_REPORT_PERIOD = 500;
     private static StatisticsCounters instanceHolder;
-    private static final Logger LOGGER = LoggerFactory.getLogger(StatisticsCounters.class);
+    private static final Logger LOG = LoggerFactory.getLogger(StatisticsCounters.class);
 
     private Timer logReporter;
     private int logReportPeriod;
@@ -70,7 +70,7 @@ public final class StatisticsCounters implements StatisticsHandler {
         runCounting = false;
         this.logReportPeriod = 0;
         this.runLogReport = false;
-        LOGGER.debug("StaticsCounters has been created");
+        LOG.debug("StaticsCounters has been created");
     }
 
     /**
@@ -83,7 +83,7 @@ public final class StatisticsCounters implements StatisticsHandler {
             return;
         }
         resetCounters();
-        LOGGER.debug("Counting started...");
+        LOG.debug("Counting started...");
         if(reportToLogs){
             startLogReport(logReportDelay);
         }
@@ -95,7 +95,7 @@ public final class StatisticsCounters implements StatisticsHandler {
      */
     public void stopCounting(){
         runCounting = false;
-        LOGGER.debug("Stop counting...");
+        LOG.debug("Stop counting...");
         stopLogReport();
     }
 
@@ -127,7 +127,7 @@ public final class StatisticsCounters implements StatisticsHandler {
         logReporter = new Timer("SC_Timer");
         logReporter.schedule(new LogReporterTask(this), this.logReportPeriod, this.logReportPeriod);
         runLogReport = true;
-        LOGGER.debug("Statistics log reporter has been scheduled with period {} ms", this.logReportPeriod);
+        LOG.debug("Statistics log reporter has been scheduled with period {} ms", this.logReportPeriod);
     }
 
     /**
@@ -137,7 +137,7 @@ public final class StatisticsCounters implements StatisticsHandler {
         if(runLogReport){
             if(logReporter != null){
                 logReporter.cancel();
-                LOGGER.debug("Statistics log reporter has been canceled");
+                LOG.debug("Statistics log reporter has been canceled");
             }
             runLogReport = false;
         }
@@ -213,7 +213,7 @@ public final class StatisticsCounters implements StatisticsHandler {
         for(CounterEventTypes cet : enabledCounters){
             countersMap.get(cet).reset();
         }
-        LOGGER.debug("StaticsCounters has been reset");
+        LOG.debug("StaticsCounters has been reset");
     }
 
     @Override
@@ -241,7 +241,7 @@ public final class StatisticsCounters implements StatisticsHandler {
         @Override
         public void run() {
             for(CounterEventTypes cet : sc.getEnabledCounters()){
-                LOG.debug(cet.name() + ": " + sc.getCountersMap().get(cet).getStat());
+                LOG.debug("{}: {}", cet.name(), sc.getCountersMap().get(cet).getStat());
             }
         }
     }
index 5de0a75f2d65c83c224090f38191babefba0f4a5..e30b4d6bd5328d0a5356c1a25035d4a3fcd3b652 100644 (file)
@@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory;
 */
 public class StatisticsCollectionModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328.AbstractStatisticsCollectionModule {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(StatisticsCollectionModule.class);
+    private static final Logger LOG = LoggerFactory.getLogger(StatisticsCollectionModule.class);
 
     public StatisticsCollectionModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
@@ -54,7 +54,7 @@ public class StatisticsCollectionModule extends org.opendaylight.yang.gen.v1.urn
         if (statsConfig != null) {
             statsCounter.startCounting(statsConfig.getStatisticsCollect(), statsConfig.getLogReportDelay());
         } else {
-            LOGGER.debug("Unable to start StatisticCounter - wrong configuration");
+            LOG.debug("Unable to start StatisticCounter - wrong configuration");
         }
 
         /* Internal MXBean implementation */
@@ -93,11 +93,11 @@ public class StatisticsCollectionModule extends org.opendaylight.yang.gen.v1.urn
                     }
                     catch (Exception e) {
                         String errMsg = "Error by stoping StatisticsCollectionService.";
-                        LOGGER.error(errMsg, e);
+                        LOG.error(errMsg, e);
                         throw new IllegalStateException(errMsg, e);
                     }
                 }
-                LOGGER.info("StatisticsCollection Service consumer (instance {} turn down.)", this);
+                LOG.info("StatisticsCollection Service consumer (instance {} turn down.)", this);
             }
 
             @Override
@@ -112,7 +112,7 @@ public class StatisticsCollectionModule extends org.opendaylight.yang.gen.v1.urn
         }
 
         AutoCloseable ret = new AutoClosableStatisticsCollection();
-        LOGGER.info("StatisticsCollection service (instance {}) initialized.", ret);
+        LOG.info("StatisticsCollection service (instance {}) initialized.", ret);
         return ret;
     }
 }
\ No newline at end of file
index fcab98877775e3a3b18d04f49250f4848cb27254..55ebf43d1f79e6fd9766404d4b766d36e6a8019e 100644 (file)
@@ -23,13 +23,13 @@ import org.slf4j.LoggerFactory;
  */
 public class DummyDecoder extends ByteToMessageDecoder {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(DummyDecoder.class);
 
     @Override
     protected void decode(ChannelHandlerContext ctx, ByteBuf in,
             List<Object> out) throws Exception {
-        LOGGER.debug("decoding");
+        LOG.debug("decoding");
         ctx.fireChannelReadComplete();
     }
 
index 00785418ce93912f0ef9f0f5fa32f136039a23c2..088201b379e572fa444702eef0a076a209c672df 100644 (file)
@@ -87,7 +87,7 @@ public class MultipartReplyMessageFactoryTest {
                 new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 19, MultipartReplyMessage.class));
     }
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(MultipartReplyMessageFactoryTest.class);
 
     /**
@@ -678,7 +678,7 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong meterBandDscp.burstSize", 32, meterBandDscp.getBurstSize().intValue());
         Assert.assertEquals("Wrong meterBandDscp.precLevel", 4, meterBandDscp.getPrecLevel().intValue());
 
-        LOGGER.info(message.getMeterConfig().get(0).getFlags().toString());
+        LOG.info(message.getMeterConfig().get(0).getFlags().toString());
         Assert.assertEquals("Wrong flags01", new MeterFlags(false, true, true, false),
                              message.getMeterConfig().get(1).getFlags());
         Assert.assertEquals("Wrong meterId01", 7,
index cc0ba0df5fb1c6b7af6b12024f47605fe8f3df11..0f70b3eacefc7a803107088b6a48489940980f64 100644 (file)
@@ -47,7 +47,8 @@ public class EchoOutputMessageFactoryTest {
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
         factory.serialize(message, serializedBuffer);
         BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 24);
-        Assert.assertArrayEquals("Wrong data", message.getData(),
-                serializedBuffer.readBytes(serializedBuffer.readableBytes()).array());
+        byte[] readData = new byte[serializedBuffer.readableBytes()];
+        serializedBuffer.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 }
index 20f8b5fc4e8a5ec8618854a4840e8ebcb56c2e60..22135bb640bfac89d0381d88cb4b01644b74bcbc 100644 (file)
@@ -49,7 +49,8 @@ public class EchoRequestMessageFactoryTest {
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
         factory.serialize(message, serializedBuffer);
         BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 24);
-        Assert.assertArrayEquals("Wrong data", message.getData(),
-                serializedBuffer.readBytes(serializedBuffer.readableBytes()).array());
+        byte[] readData = new byte[serializedBuffer.readableBytes()];
+        serializedBuffer.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 }
index ff3e70ea0aa9099838218c70ce4ce32b28011a8c..929cbefe6b2642fc8c3b51c369d902237edecd9c 100644 (file)
@@ -52,7 +52,8 @@ public class ErrorMessageFactoryTest {
         BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 28);
         Assert.assertEquals("Wrong Type", message.getType().intValue(), serializedBuffer.readShort());
         Assert.assertEquals("Wrong Code", message.getCode().intValue(), serializedBuffer.readShort());
-        Assert.assertArrayEquals("Wrong data", message.getData(),
-                serializedBuffer.readBytes(serializedBuffer.readableBytes()).array());
+        byte[] readData = new byte[serializedBuffer.readableBytes()];
+        serializedBuffer.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 }
index d947b3fdf068eb8e0c86f3fc2f128130ef14f33a..e9319a96208bfa5ba079df16fd17712fb89d47da 100644 (file)
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
  */
 public class HelloInputMessageFactoryTest {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(HelloInputMessageFactoryTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(HelloInputMessageFactoryTest.class);
     private SerializerRegistry registry;
     private OFSerializer<HelloInput> helloFactory;
 
@@ -84,8 +84,8 @@ public class HelloInputMessageFactoryTest {
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         helloFactory.serialize(message, out);
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug("bytebuf: {}", ByteBufUtils.byteBufToHexString(out));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("bytebuf: {}", ByteBufUtils.byteBufToHexString(out));
         }
 
         BufferHelper.checkHeaderV13(out, (byte) 0, 16);
@@ -110,8 +110,8 @@ public class HelloInputMessageFactoryTest {
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         helloFactory.serialize(message, out);
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug("bytebuf: ", ByteBufUtils.byteBufToHexString(out));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("bytebuf: ", ByteBufUtils.byteBufToHexString(out));
         }
 
         BufferHelper.checkHeaderV13(out, (byte) 0, 24);
@@ -146,7 +146,7 @@ public class HelloInputMessageFactoryTest {
                 booleanList.add(false);
             }
         }
-        LOGGER.debug("boolsize {}", booleanList.size());
+        LOG.debug("boolsize {}", booleanList.size());
         elementsBuilder.setType(HelloElementType.forValue(1));
         elementsBuilder.setVersionBitmap(booleanList);
         elementsList.add(elementsBuilder.build());
index 5d3c3a8d97a75a19e19dd6e8178704fb9e1717c4..abe0055dd2604aa7c7d3b33aadd4e7a370adb589 100644 (file)
@@ -58,7 +58,8 @@ public class OF10PacketInMessageFactoryTest {
         Assert.assertEquals("Wrong port in", message.getInPort().intValue(), serializedBuffer.readUnsignedShort());
         Assert.assertEquals("Wrong reason", message.getReason().getIntValue(), serializedBuffer.readUnsignedByte());
         serializedBuffer.skipBytes(1);
-        Assert.assertArrayEquals("Wrong data", message.getData(),
-                serializedBuffer.readBytes(serializedBuffer.readableBytes()).array());
+        byte[] readData = new byte[serializedBuffer.readableBytes()];
+        serializedBuffer.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 }
index 6b1ff682edfed40a730ae6ddada2957063e9a98b..af4f139e93c0506b2f8a9202da144fc76e90639e 100644 (file)
@@ -94,7 +94,9 @@ public class OF10PacketOutInputMessageFactoryTest {
         Assert.assertEquals("Wrong action type", 3, out.readUnsignedShort());
         Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
         out.skipBytes(4);
-        Assert.assertArrayEquals("Wrong data", message.getData(), out.readBytes(out.readableBytes()).array());
+        byte[] readData = new byte[out.readableBytes()];
+        out.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
         Assert.assertTrue("Unread data", out.readableBytes() == 0);
     }
 
index 550e9c72c60d317ca53ccab54960c6f5e69e1f08..8f917b7b148a227c83656f1d5e81ce06ea109c73 100644 (file)
@@ -121,8 +121,9 @@ public class PacketInMessageFactoryTest {
         Assert.assertEquals("Wrong oxm value", 4, serializedBuffer.readUnsignedByte());
         serializedBuffer.skipBytes(7);
         serializedBuffer.skipBytes(PADDING);
-        Assert.assertArrayEquals("Wrong data", message.getData(),
-                serializedBuffer.readBytes(serializedBuffer.readableBytes()).array());
+        byte[] readData = new byte[serializedBuffer.readableBytes()];
+        serializedBuffer.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 
 }
index 50c0839f121bc9cd1aec759a91560a628d7ac762..60ee5210f1e68fdaddffd0fceb27bc08091b0bb8 100644 (file)
@@ -96,7 +96,9 @@ public class PacketOutInputMessageFactoryTest {
         Assert.assertEquals("Wrong action type", 18, out.readUnsignedShort());
         Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
         out.skipBytes(PADDING_IN_ACTION_HEADER);
-        Assert.assertArrayEquals("Wrong data", message.getData(), out.readBytes(out.readableBytes()).array());
+        byte[] readData = new byte[out.readableBytes()];
+        out.readBytes(readData);
+        Assert.assertArrayEquals("Wrong data", message.getData(), readData);
     }
 
     /**
index 76fe9888a5ccfe9469eb046022553e5cc798b7d9..b9d2b0f5ee87a5e5e42bcdf9e804aeebca3d8ec8 100644 (file)
@@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ActionsDeserializerTest {
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(ActionsDeserializerTest.class);
     private DeserializerRegistry registry;
 
@@ -82,7 +82,7 @@ public class ActionsDeserializerTest {
                 + "00 1B 00 08 00 00 00 00");
 
         message.skipBytes(4); // skip XID
-        LOGGER.info("bytes: {}", message.readableBytes());
+        LOG.info("bytes: {}", message.readableBytes());
 
         CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID);
         List<Action> actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
index 999607d2f022a0fc9f8e0d593f9f0b925f971db4..94b90b9dedb722d3837baea01dc14d95a4a5e9c9 100644 (file)
@@ -283,7 +283,7 @@ public class OF13MatchSerializerTest {
         byte[] label = new byte[4];
         out.readBytes(label);
 
-        LOG.debug("label: "+ ByteBufUtils.bytesToHexString(label));
+        LOG.debug("label: {}", ByteBufUtils.bytesToHexString(label));
         Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d}, label);
     }
 
index fb641622dddf61b5c768ada979d39fdae9615750..6f2f772cbb62d170b38a42b4329ca9b52e2ddf7e 100644 (file)
@@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory;
  */
 public class StatisticsCountersTest {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(StatisticsCountersTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(StatisticsCountersTest.class);
     private StatisticsCounters statCounters;
 
     /**
@@ -81,7 +81,7 @@ public class StatisticsCountersTest {
             Assert.fail("No counter is enabled");
         }
         incrementCounter(firstEnabledCET,testCount);
-        LOGGER.debug("Waiting to process event queue");
+        LOG.debug("Waiting to process event queue");
         Assert.assertEquals("Wrong - bad last read value.", 0,statCounters.getCounter(firstEnabledCET).getCounterLastReadValue());
         Assert.assertEquals("Wrong - bad value", testCount,statCounters.getCounter(firstEnabledCET).getCounterValue(false));
         Assert.assertEquals("Wrong - bad last read value.", 0,statCounters.getCounter(firstEnabledCET).getCounterLastReadValue());
index 559c2279f81e7a9321eda696cc49bfb58a058edd..5afb039f17443a4592b61b35d0cae30969de2146 100644 (file)
@@ -29,7 +29,7 @@ import com.google.common.util.concurrent.SettableFuture;
  */
 public class ListeningSimpleClient implements OFClient {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(ListeningSimpleClient.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ListeningSimpleClient.class);
     private int port;
     private boolean securedClient = false;
     private EventLoopGroup workerGroup;
@@ -73,21 +73,21 @@ public class ListeningSimpleClient implements OFClient {
             isOnlineFuture.set(true);
 
             synchronized (scenarioHandler) {
-                LOGGER.debug("WAITING FOR SCENARIO");
+                LOG.debug("WAITING FOR SCENARIO");
                 while (! scenarioHandler.isScenarioFinished()) {
                     scenarioHandler.wait();
                 }
             }
         } catch (Exception ex) {
-            LOGGER.error(ex.getMessage(), ex);
+            LOG.error(ex.getMessage(), ex);
         } finally {
-            LOGGER.debug("listening client shutting down");
+            LOG.debug("listening client shutting down");
             try {
                 workerGroup.shutdownGracefully().get();
                 bossGroup.shutdownGracefully().get();
-                LOGGER.debug("listening client shutdown succesful");
+                LOG.debug("listening client shutdown succesful");
             } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error(e.getMessage(), e);
+                LOG.error(e.getMessage(), e);
             }
         }
         scenarioDone.set(true);
@@ -97,7 +97,7 @@ public class ListeningSimpleClient implements OFClient {
      * @return close future
      */
     public Future<?> disconnect() {
-        LOGGER.debug("disconnecting client");
+        LOG.debug("disconnecting client");
         return workerGroup.shutdownGracefully();
     }
 
index 57865d88601b10b333e51c538c7a83cc08746ee5..44abb36d0ab1a3595966ff1ed0bb144e8c84c884 100644 (file)
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ScenarioHandler extends Thread {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(ScenarioHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ScenarioHandler.class);
     private Deque<ClientEvent> scenario;
     private BlockingQueue<byte[]> ofMsg;
     private ChannelHandlerContext ctx;
@@ -45,19 +45,19 @@ public class ScenarioHandler extends Thread {
     public void run() {
         int freezeCounter = 0;
         while (!scenario.isEmpty()) {
-            LOGGER.debug("Running event #{}", eventNumber);
+            LOG.debug("Running event #{}", eventNumber);
             ClientEvent peek = scenario.peekLast();
             if (peek instanceof WaitForMessageEvent) {
-                LOGGER.debug("WaitForMessageEvent");
+                LOG.debug("WaitForMessageEvent");
                 try {
                     WaitForMessageEvent event = (WaitForMessageEvent) peek;
                     event.setHeaderReceived(ofMsg.poll(2000, TimeUnit.MILLISECONDS));
                 } catch (InterruptedException e) {
-                    LOGGER.error(e.getMessage(), e);
+                    LOG.error(e.getMessage(), e);
                     break;
                 }
             } else if (peek instanceof SendEvent) {
-                LOGGER.debug("Proceed - sendevent");
+                LOG.debug("Proceed - sendevent");
                 SendEvent event = (SendEvent) peek;
                 event.setCtx(ctx);
             }
@@ -69,16 +69,16 @@ public class ScenarioHandler extends Thread {
                 freezeCounter++;
             }
             if (freezeCounter > 2) {
-                LOGGER.warn("Scenario frozen: {}", freezeCounter);
+                LOG.warn("Scenario frozen: {}", freezeCounter);
                 break;
             }
             try {
                 sleep(100);
             } catch (InterruptedException e) {
-                LOGGER.error(e.getMessage(), e);
+                LOG.error(e.getMessage(), e);
             }
         }
-        LOGGER.debug("Scenario finished");
+        LOG.debug("Scenario finished");
         synchronized (this) {
             scenarioFinished = true;
             this.notify();
index 3f456d12cdece4467ca86c354a3c63a99d142344..9318d231d5618a0592420cb980a882a3edb83be5 100644 (file)
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
  */
 public class SendEvent implements ClientEvent {
 
-    protected static final Logger LOGGER = LoggerFactory.getLogger(SendEvent.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SendEvent.class);
     protected byte[] msgToSend;
     protected ChannelHandlerContext ctx;
 
@@ -38,15 +38,15 @@ public class SendEvent implements ClientEvent {
 
     @Override
     public boolean eventExecuted() {
-        LOGGER.debug("sending message");
-        LOGGER.debug("start of run");
+        LOG.debug("sending message");
+        LOG.debug("start of run");
         ByteBuf buffer = ctx.alloc().buffer();
         buffer.writeBytes(msgToSend);
         ctx.writeAndFlush(buffer);
 
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug(">> {}", ByteBufUtils.bytesToHexString(msgToSend));
-            LOGGER.debug("message sent");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(">> {}", ByteBufUtils.bytesToHexString(msgToSend));
+            LOG.debug("message sent");
         }
         return true;
     }
index 5e98e3d601ad5c7d9ed731b48ba0d37a15dbe549..fb0fda091eff18268c39dd9f1ede432fa84198e5 100644 (file)
@@ -29,7 +29,7 @@ import com.google.common.util.concurrent.SettableFuture;
  */
 public class SimpleClient implements OFClient {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleClient.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SimpleClient.class);
     private final String host;
     private final int port;
     private boolean securedClient = false;
@@ -72,20 +72,20 @@ public class SimpleClient implements OFClient {
             b.connect(host, port).sync();
 
             synchronized (scenarioHandler) {
-                LOGGER.debug("WAITING FOR SCENARIO");
+                LOG.debug("WAITING FOR SCENARIO");
                 while (! scenarioHandler.isScenarioFinished()) {
                     scenarioHandler.wait();
                 }
             }
         } catch (Exception ex) {
-            LOGGER.error(ex.getMessage(), ex);
+            LOG.error(ex.getMessage(), ex);
         } finally {
-            LOGGER.debug("shutting down");
+            LOG.debug("shutting down");
             try {
                 group.shutdownGracefully().get();
-                LOGGER.debug("shutdown succesful");
+                LOG.debug("shutdown succesful");
             } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error(e.getMessage(), e);
+                LOG.error(e.getMessage(), e);
             }
         }
         scenarioDone.set(true);
@@ -95,7 +95,7 @@ public class SimpleClient implements OFClient {
      * @return close future
      */
     public Future<?> disconnect() {
-        LOGGER.debug("disconnecting client");
+        LOG.debug("disconnecting client");
         return group.shutdownGracefully();
     }
 
@@ -115,8 +115,8 @@ public class SimpleClient implements OFClient {
         int port;
         SimpleClient sc;
         if (args.length != 3) {
-            LOGGER.error("Usage: {} <host> <port> <secured>", SimpleClient.class.getSimpleName());
-            LOGGER.error("Trying to use default setting.");
+            LOG.error("Usage: {} <host> <port> <secured>", SimpleClient.class.getSimpleName());
+            LOG.error("Trying to use default setting.");
             InetAddress ia = InetAddress.getLocalHost();
             InetAddress[] all = InetAddress.getAllByName(ia.getHostName());
             host = all[0].getHostAddress();
index 1420ad8d023a68599a1ff293788e3197daba3458..02c9cd98d85a0c7b5560d82027be538c0c8e6943 100644 (file)
@@ -28,34 +28,34 @@ public class SimpleClientFramer extends ByteToMessageDecoder {
     /** Length of OpenFlow 1.3 header */
     public static final byte LENGTH_OF_HEADER = 8;
     private static final byte LENGTH_INDEX_IN_HEADER = 2;
-    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleClientFramer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SimpleClientFramer.class);
 
     /**
      * Constructor of class.
      */
     public SimpleClientFramer() {
-        LOGGER.trace("Creating OFFrameDecoder");
+        LOG.trace("Creating OFFrameDecoder");
     }
 
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-        LOGGER.warn("Unexpected exception from downstream.", cause);
+        LOG.warn("Unexpected exception from downstream.", cause);
         ctx.close();
     }
 
     @Override
     protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
         if (bb.readableBytes() < LENGTH_OF_HEADER) {
-            LOGGER.debug("skipping bb - too few data for header: {}", bb.readableBytes());
+            LOG.debug("skipping bb - too few data for header: {}", bb.readableBytes());
             return;
         }
 
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
         if (bb.readableBytes() < length) {
-            LOGGER.debug("skipping bb - too few data for msg: {} < {}", bb.readableBytes(), length);
+            LOG.debug("skipping bb - too few data for msg: {} < {}", bb.readableBytes(), length);
             return;
         }
-        LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
+        LOG.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
 
         ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
         list.add(messageBuffer);
index acc538340d9115190fa17eeb45ddabf67ddf55c0..863f9aebada634e3e4c4e2e4b1b50d8d1015144b 100644 (file)
@@ -25,7 +25,7 @@ import com.google.common.util.concurrent.SettableFuture;
  */
 public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
 
-    protected static final Logger LOGGER = LoggerFactory.getLogger(SimpleClientHandler.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SimpleClientHandler.class);
     private static final int LENGTH_INDEX_IN_HEADER = 2;
     private SettableFuture<Boolean> isOnlineFuture;
     protected ScenarioHandler scenarioHandler;
@@ -42,20 +42,20 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
     @Override
     public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
         ByteBuf bb = (ByteBuf) msg;
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug("<< {}", ByteBufUtils.byteBufToHexString(bb));
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(bb));
         }
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
-        LOGGER.trace("SimpleClientHandler - start of read");
+        LOG.trace("SimpleClientHandler - start of read");
         byte[] message = new byte[length];
         bb.readBytes(message);
         scenarioHandler.addOfMsg(message);
-        LOGGER.trace("end of read");
+        LOG.trace("end of read");
     }
 
     @Override
     public void channelActive(ChannelHandlerContext ctx) throws Exception {
-        LOGGER.debug("Client is active");
+        LOG.debug("Client is active");
         if (isOnlineFuture != null) {
             isOnlineFuture.set(true);
             isOnlineFuture = null;
index b1e1a50c64f5e5ebda864be74763050a440ea58d..19229abce3f5684888cb29776d228048bdbbb889 100644 (file)
@@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory;
  */
 public class SleepEvent implements ClientEvent {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(SleepEvent.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SleepEvent.class);
     private long sleepTime;
 
     /**
@@ -33,10 +33,10 @@ public class SleepEvent implements ClientEvent {
     public boolean eventExecuted() {
         try {
             Thread.sleep(sleepTime);
-            LOGGER.debug("Sleeping");
+            LOG.debug("Sleeping");
             return true;
         } catch (InterruptedException e) {
-            LOGGER.error(e.getMessage(), e);
+            LOG.error(e.getMessage(), e);
         }
         return false;
     }
index e9d4644e174079273f528619b1a84214ddb63588..f7ff0a619899c16e188701d025613b6bd73f8308 100644 (file)
@@ -30,7 +30,7 @@ import com.google.common.util.concurrent.SettableFuture;
  */
 public class UdpSimpleClient implements OFClient {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(UdpSimpleClient.class);
+    private static final Logger LOG = LoggerFactory.getLogger(UdpSimpleClient.class);
     private final String host;
     private final int port;
     private EventLoopGroup group;
@@ -73,20 +73,20 @@ public class UdpSimpleClient implements OFClient {
             b.connect(host, port).sync();
 
             synchronized (scenarioHandler) {
-                LOGGER.debug("WAITING FOR SCENARIO");
+                LOG.debug("WAITING FOR SCENARIO");
                 while (! scenarioHandler.isScenarioFinished()) {
                     scenarioHandler.wait();
                 }
             }
         } catch (Exception ex) {
-            LOGGER.error(ex.getMessage(), ex);
+            LOG.error(ex.getMessage(), ex);
         } finally {
-            LOGGER.debug("shutting down");
+            LOG.debug("shutting down");
             try {
                 group.shutdownGracefully().get();
-                LOGGER.debug("shutdown succesful");
+                LOG.debug("shutdown succesful");
             } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error(e.getMessage(), e);
+                LOG.error(e.getMessage(), e);
             }
         }
         scenarioDone.set(true);
@@ -96,7 +96,7 @@ public class UdpSimpleClient implements OFClient {
      * @return close future
      */
     public Future<?> disconnect() {
-        LOGGER.debug("disconnecting client");
+        LOG.debug("disconnecting client");
         return group.shutdownGracefully();
     }
 
@@ -111,8 +111,8 @@ public class UdpSimpleClient implements OFClient {
         int port;
         UdpSimpleClient sc;
         if (args.length != 2) {
-            LOGGER.error("Usage: {} <host> <port>", UdpSimpleClient.class.getSimpleName());
-            LOGGER.error("Trying to use default setting.");
+            LOG.error("Usage: {} <host> <port>", UdpSimpleClient.class.getSimpleName());
+            LOG.error("Trying to use default setting.");
             InetAddress ia = InetAddress.getLocalHost();
             InetAddress[] all = InetAddress.getAllByName(ia.getHostName());
             host = all[0].getHostAddress();
index be73d27c8d224ffffbdd75f820c27e251d359b96..b893a8f346c137b2fad81c694c6b022a7a3ae086 100644 (file)
@@ -29,18 +29,18 @@ public class UdpSimpleClientFramer extends MessageToMessageDecoder<DatagramPacke
     /** Length of OpenFlow 1.3 header */
     public static final byte LENGTH_OF_HEADER = 8;
     private static final byte LENGTH_INDEX_IN_HEADER = 2;
-    private static final Logger LOGGER = LoggerFactory.getLogger(UdpSimpleClientFramer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(UdpSimpleClientFramer.class);
 
     /**
      * Constructor of class.
      */
     public UdpSimpleClientFramer() {
-        LOGGER.trace("Creating OFFrameDecoder");
+        LOG.trace("Creating OFFrameDecoder");
     }
 
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-        LOGGER.warn("Unexpected exception from downstream.", cause);
+        LOG.warn("Unexpected exception from downstream.", cause);
         ctx.close();
     }
 
@@ -48,16 +48,16 @@ public class UdpSimpleClientFramer extends MessageToMessageDecoder<DatagramPacke
     protected void decode(ChannelHandlerContext chc, DatagramPacket msg, List<Object> list) throws Exception {
         ByteBuf bb = msg.content();
         if (bb.readableBytes() < LENGTH_OF_HEADER) {
-            LOGGER.debug("skipping bb - too few data for header: {}", bb.readableBytes());
+            LOG.debug("skipping bb - too few data for header: {}", bb.readableBytes());
             return;
         }
 
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
         if (bb.readableBytes() < length) {
-            LOGGER.debug("skipping bb - too few data for msg: {} < {}", bb.readableBytes(), length);
+            LOG.debug("skipping bb - too few data for msg: {} < {}", bb.readableBytes(), length);
             return;
         }
-        LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
+        LOG.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
 
         ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
         list.add(messageBuffer);
index b448111a85e7a74af188462091945cfdea36ac1a..59228e3645a6ac4e6703f4ddd48008ab2a1963d5 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
  */
 public class WaitForMessageEvent implements ClientEvent {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(WaitForMessageEvent.class);
+    private static final Logger LOG = LoggerFactory.getLogger(WaitForMessageEvent.class);
     private byte[] headerExpected;
     private byte[] headerReceived;
 
@@ -40,13 +40,13 @@ public class WaitForMessageEvent implements ClientEvent {
             return false;
         }
         if (!Arrays.equals(headerExpected, headerReceived)) {
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER.debug("expected msg: {}", ByteBufUtils.bytesToHexString(headerExpected));
-                LOGGER.debug("received msg: {}", ByteBufUtils.bytesToHexString(headerReceived));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("expected msg: {}", ByteBufUtils.bytesToHexString(headerExpected));
+                LOG.debug("received msg: {}", ByteBufUtils.bytesToHexString(headerReceived));
             }
             return false;
         }
-        LOGGER.debug("Headers OK");
+        LOG.debug("Headers OK");
         return true;
     }