X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=samples%2Fsimple-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fclients%2FSimpleClientHandler.java;h=cbff4822f351059c82c6d4e2690a7f77ebefd5b7;hb=3a44a80f20e2ad3b9683a8ef2c459f96a86c53fb;hp=863f9aebada634e3e4c4e2e4b1b50d8d1015144b;hpb=9688b3b10ee4113753705f0080b29cd30e61a85d;p=openflowplugin.git diff --git a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java index 863f9aebad..cbff4822f3 100644 --- a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java +++ b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java @@ -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; } }