X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fhandler%2FNetconfMessageAggregator.java;h=b67f48f5fcf3014b06f701c18a956bfed0a78e5b;hb=549b3260a884bf1801d6ea1a0f4ffb7bb5ed2bf5;hp=131c3d71a57c9df779302ca4ff352e10f53841e6;hpb=e6bcd06e610be274e8f2df901b61789bb17c442a;p=controller.git diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageAggregator.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageAggregator.java index 131c3d71a5..b67f48f5fc 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageAggregator.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageAggregator.java @@ -8,26 +8,26 @@ package org.opendaylight.controller.netconf.util.handler; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; + import java.util.List; import org.opendaylight.controller.netconf.util.messages.FramingMechanism; -import org.opendaylight.controller.netconf.util.messages.NetconfMessageFactory; +import org.opendaylight.controller.netconf.util.messages.NetconfMessageConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.ByteToMessageDecoder; - public class NetconfMessageAggregator extends ByteToMessageDecoder { private final static Logger logger = LoggerFactory.getLogger(NetconfMessageAggregator.class); - private byte[] eom = NetconfMessageFactory.endOfMessage; + private byte[] eom = NetconfMessageConstants.endOfMessage; public NetconfMessageAggregator(FramingMechanism framingMechanism) { if (framingMechanism == FramingMechanism.CHUNK) { - eom = NetconfMessageFactory.endOfChunk; + eom = NetconfMessageConstants.endOfChunk; } } @@ -35,13 +35,13 @@ public class NetconfMessageAggregator extends ByteToMessageDecoder { protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { int index = indexOfSequence(in, eom); if (index == -1) { - logger.debug("Message is not complete, read agian."); + logger.debug("Message is not complete, read again."); ctx.read(); } else { ByteBuf msg = in.readBytes(index); in.readBytes(eom.length); in.discardReadBytes(); - logger.debug("Message is complete. {}", msg.readableBytes()); + logger.debug("Message is complete."); out.add(msg); } }