* @param connectionAdapter reference for adapter communicating with upper layers outside library
*/
public DelegatingInboundHandler(MessageConsumer connectionAdapter) {
- LOGGER.debug("Creating DelegatingInboundHandler");
+ LOGGER.trace("Creating DelegatingInboundHandler");
consumer = connectionAdapter;
}
@Override
public void channelRead(ChannelHandlerContext ctx, final Object msg)
throws Exception {
- LOGGER.debug("Reading");
consumer.consume((DataObject) msg);
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
- LOGGER.info("Channel inactive");
+ LOGGER.debug("Channel inactive");
if (!inactiveMessageSent) {
DisconnectEventBuilder builder = new DisconnectEventBuilder();
builder.setInfo("Channel inactive");
@Override
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
- LOGGER.info("Channel unregistered");
+ LOGGER.debug("Channel unregistered");
if (!inactiveMessageSent) {
DisconnectEventBuilder builder = new DisconnectEventBuilder();
builder.setInfo("Channel unregistered");
protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt)
throws Exception {
if ((evt.state() == IdleState.READER_IDLE) && (evt.isFirst())) {
- LOGGER.info("Switch idle");
+ LOGGER.debug("Switch idle");
SwitchIdleEventBuilder builder = new SwitchIdleEventBuilder();
builder.setInfo("Switch idle");
ctx.fireChannelRead(builder.build());
* Constructor of class
*/
public OFDecoder() {
- LOGGER.debug("Creating OF 1.3 Decoder");
+ LOGGER.trace("Creating OF 1.3 Decoder");
}
@Override
List<Object> out) throws Exception {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("VersionMessageWrapper received");
- LOGGER.debug("buffer size: " + msg.getMessageBuffer().readableBytes());
LOGGER.debug("<< " + ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
}
DataObject dataObject = null;
/** Constructor of class */
public OFEncoder() {
- LOGGER.debug("Creating OF13Encoder");
+ LOGGER.trace("Creating OF13Encoder");
}
@Override
protected void encode(ChannelHandlerContext ctx, OfHeader msg, ByteBuf out)
throws Exception {
- LOGGER.debug("Encoding");
+ LOGGER.trace("Encoding");
try {
SerializationFactory.messageToBuffer(msg.getVersion(), out, msg);
} catch(Exception e) {
* Constructor of class.
*/
public OFFrameDecoder() {
- LOGGER.debug("Creating OFFrameDecoder");
+ LOGGER.trace("Creating OFFrameDecoder");
}
@Override
LOGGER.debug("skipping bb - too few data for msg: " +
readableBytes + " < " + length);
LOGGER.debug("bb: " + ByteBufUtils.byteBufToHexString(bb));
- LOGGER.debug("readableBytes: " + readableBytes);
}
-
return;
- } else {
- LOGGER.debug("[enough bytes] readableBytes: " + readableBytes);
}
- LOGGER.info("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
+ LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1));
ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
list.add(messageBuffer);
* Constructor of class.
*/
public OFVersionDetector() {
- LOGGER.debug("Creating OFVersionDetector");
+ LOGGER.trace("Creating OFVersionDetector");
}
@Override
bb.release();
return;
}
- LOGGER.debug("RI: " + bb.readerIndex());
byte version = bb.readByte();
-
if ((version == OF13_VERSION_ID) || (version == OF10_VERSION_ID)) {
LOGGER.debug("detected version: " + version);
} else {
* Constructor of class
*/
public TlsDetector() {
- LOGGER.debug("Creating TLS Detector");
+ LOGGER.trace("Creating TLS Detector");
detectSsl = true;
}
private boolean isSsl(ByteBuf bb) {
if (detectSsl) {
- LOGGER.info("Testing connection for TLS");
+ LOGGER.trace("Testing connection for TLS");
return SslHandler.isEncrypted(bb);
}
return false;
private static void enableSsl(ChannelHandlerContext ctx) {
if (ctx.pipeline().get(COMPONENT_NAMES.SSL_HANDLER.name()) == null) {
- LOGGER.info("Engaging TLS handler");
+ LOGGER.trace("Engaging TLS handler");
ChannelPipeline p = ctx.channel().pipeline();
SSLEngine engine = SslContextFactory.getServerContext()
.createSSLEngine();
LOGGER.debug(ByteBufUtils.byteBufToHexString(bb));
}
if (isSsl(bb)) {
- LOGGER.info("Connection is encrypted");
+ LOGGER.debug("Connection is encrypted");
enableSsl(ctx);
} else {
- LOGGER.info("Connection is not encrypted");
+ LOGGER.debug("Connection is not encrypted");
}
if (connectionFacade != null) {
- LOGGER.debug("Firing onConnectionReady notification");
+ LOGGER.trace("Firing onConnectionReady notification");
connectionFacade.fireConnectionReadyNotification();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.HelloElementType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Translates Hello messages
/** Size of hello element header (in bytes) */
public static final byte HELLO_ELEMENT_HEADER_SIZE = 4;
private static HelloInputMessageFactory instance;
-
- private static final Logger LOGGER = LoggerFactory
- .getLogger(HelloInputMessageFactory.class);
-
-
+
private HelloInputMessageFactory() {
// do nothing, just singleton
}
encodeElementsList(message, out);
int endWriterIndex = out.writerIndex();
int writtenBytesDiff = computeLength(message) - (endWriterIndex - startWriterIndex);
- LOGGER.debug("writtenbytes: " + writtenBytesDiff);
ByteBufUtils.padBuffer(writtenBytesDiff, out);
}
short bitmapLength = computeVersionBitmapLength(currElement);
output.writeShort(bitmapLength);
versionBitmap = ByteBufUtils.fillBitMaskFromList(currElement.getVersionBitmap());
- LOGGER.debug("vbs: " + versionBitmap.length);
- LOGGER.debug("Version bitmap (below):");
for (int i = 0; i < versionBitmap.length; i++) {
- LOGGER.debug(Integer.toBinaryString(versionBitmap[i]));
output.writeInt(versionBitmap[i]);
}
int padding = bitmapLength - versionBitmap.length * 4 - HELLO_ELEMENT_HEADER_SIZE;
*/
public static void encodeMatchEntries(List<MatchEntries> matchEntries, ByteBuf out) {
if (matchEntries == null) {
- LOGGER.warn("Match entries are null");
+ LOGGER.debug("Match entries are null");
return;
}
for (MatchEntries entry : matchEntries) {
*/
public static void encodeMatchIds(List<MatchEntries> matchEntries, ByteBuf out) {
if (matchEntries == null) {
- LOGGER.warn("Match entries are null");
+ LOGGER.debug("Match entries are null");
return;
}
for (MatchEntries entry : matchEntries) {
/** Creates MockPlugin */
public MockPlugin() {
- LOGGER.info("Creating MockPlugin");
+ LOGGER.trace("Creating MockPlugin");
finishedFuture = SettableFuture.create();
- LOGGER.info("mockPlugin: "+System.identityHashCode(this));
+ LOGGER.debug("mockPlugin: "+System.identityHashCode(this));
}
@Override
public void onSwitchConnected(ConnectionAdapter connection) {
- LOGGER.info("onSwitchConnected: " + connection);
+ LOGGER.debug("onSwitchConnected: " + connection);
this.adapter = connection;
connection.setMessageListener(this);
connection.setSystemListener(this);
if (rpcResult.isSuccessful()) {
byte[] byteArray = rpcResult.getResult().getDatapathId()
.toByteArray();
- LOGGER.info("DatapathId: " + Arrays.toString(byteArray));
+ LOGGER.debug("DatapathId: " + Arrays.toString(byteArray));
} else {
RpcError rpcError = rpcResult.getErrors().iterator().next();
LOGGER.warn("rpcResult failed: "
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOGGER.error(e.getMessage(), e);
}
- LOGGER.info("After FeaturesReply message");
+ LOGGER.debug("After FeaturesReply message");
}
protected void shutdown() {
LOGGER.debug("adapter: "+adapter);
try {
- LOGGER.info("mockPlugin: "+System.identityHashCode(this));
+ LOGGER.debug("mockPlugin: "+System.identityHashCode(this));
Thread.sleep(500);
if (adapter != null) {
Future<Boolean> disconnect = adapter.disconnect();
disconnect.get();
- LOGGER.info("Disconnected");
+ LOGGER.debug("Disconnected");
}
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
}
- LOGGER.info("Scenario finished");
+ LOGGER.debug("Scenario finished");
synchronized (this) {
this.notify();
}
} catch (Exception ex) {
LOGGER.error(ex.getMessage(), ex);
} finally {
- LOGGER.info("shutting down");
+ LOGGER.debug("shutting down");
try {
group.shutdownGracefully().get();
- LOGGER.info("shutdown succesful");
+ LOGGER.debug("shutdown succesful");
} catch (InterruptedException | ExecutionException e) {
LOGGER.error(e.getMessage(), e);
}
* Constructor of class.
*/
public SimpleClientFramer() {
- LOGGER.debug("Creating OFFrameDecoder");
+ LOGGER.trace("Creating OFFrameDecoder");
}
@Override
bb.readableBytes() + " < " + length);
return;
}
- LOGGER.info("OF Protocol message received, type:{}", bb.getByte(1));
+ LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(1));
ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
list.add(messageBuffer);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("<< " + ByteBufUtils.byteBufToHexString(bb));
}
- int length = bb.getUnsignedShort(LENGTH_INDEX_IN_HEADER);
- LOGGER.info("SimpleClientHandler - start of read");
+ int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER);
+ LOGGER.trace("SimpleClientHandler - start of read");
byte[] message = new byte[length];
bb.readBytes(message);
scenarioHandler.addOfMsg(message);
- LOGGER.info("end of read");
+ LOGGER.trace("end of read");
}
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
- LOGGER.info("Client is active");
+ LOGGER.debug("Client is active");
if (isOnlineFuture != null) {
isOnlineFuture.set(true);
isOnlineFuture = null;
LOGGER.debug("received msg: " + ByteBufUtils.bytesToHexString(headerReceived));
return false;
}
- LOGGER.info("Headers OK");
+ LOGGER.debug("Headers OK");
return true;
}