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
*/
protected ScenarioHandler scenarioHandler;
/**
+ * Constructor.
+ *
* @param isOnlineFuture future notifier of connected channel
* @param scenarioHandler handler of scenario events
*/
}
@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");
}
@Override
- public void channelActive(ChannelHandlerContext ctx) throws Exception {
+ public void channelActive(ChannelHandlerContext ctx) {
LOG.debug("Client is active");
if (isOnlineFuture != null) {
isOnlineFuture.set(true);
}
/**
- * @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;
}
}