Merge "Remove redundant exception declarations"
[openflowplugin.git] / samples / simple-client / src / main / java / org / opendaylight / openflowjava / protocol / impl / clients / SimpleClientHandler.java
index 863f9aebada634e3e4c4e2e4b1b50d8d1015144b..cbff4822f351059c82c6d4e2690a7f77ebefd5b7 100644 (file)
@@ -9,17 +9,16 @@
 
 package org.opendaylight.openflowjava.protocol.impl.clients;
 
+import com.google.common.util.concurrent.SettableFuture;
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
-
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.util.concurrent.SettableFuture;
-
 /**
+ * Simple client handler.
  *
  * @author michal.polkorab
  */
@@ -31,6 +30,8 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
     protected ScenarioHandler scenarioHandler;
 
     /**
+     * Constructor.
+     *
      * @param isOnlineFuture future notifier of connected channel
      * @param scenarioHandler handler of scenario events
      */
@@ -40,10 +41,10 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
     }
 
     @Override
-    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
+    public void channelRead(ChannelHandlerContext ctx, Object msg) {
         ByteBuf bb = (ByteBuf) msg;
         if (LOG.isDebugEnabled()) {
-            LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(bb));
+            LOG.debug("Message {}", ByteBufUtils.byteBufToHexString(bb));
         }
         int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
         LOG.trace("SimpleClientHandler - start of read");
@@ -54,7 +55,7 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
     }
 
     @Override
-    public void channelActive(ChannelHandlerContext ctx) throws Exception {
+    public void channelActive(ChannelHandlerContext ctx) {
         LOG.debug("Client is active");
         if (isOnlineFuture != null) {
             isOnlineFuture.set(true);
@@ -66,10 +67,12 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
     }
 
     /**
-     * @param scenarioHandler handler of scenario events
+     * Sets the ScenarioHandler.
+     *
+     * @param handler handler of scenario events
      */
-    public void setScenario(ScenarioHandler scenarioHandler) {
-        this.scenarioHandler = scenarioHandler;
+    public void setScenario(ScenarioHandler handler) {
+        this.scenarioHandler = handler;
     }
 
 }