Example usage for io.netty.handler.codec ByteToMessageDecoder subclass-usage

List of usage examples for io.netty.handler.codec ByteToMessageDecoder subclass-usage

Introduction

In this page you can find the example usage for io.netty.handler.codec ByteToMessageDecoder subclass-usage.

Usage

From source file org.opendaylight.controller.netconf.util.handler.NetconfChunkAggregator.java

public class NetconfChunkAggregator extends ByteToMessageDecoder {
    private final static Logger logger = LoggerFactory.getLogger(NetconfChunkAggregator.class);
    public static final int DEFAULT_MAXIMUM_CHUNK_SIZE = 16 * 1024 * 1024;

    private static enum State {
        HEADER_ONE, // \n

From source file org.opendaylight.controller.netconf.util.handler.NetconfEOMAggregator.java

public class NetconfEOMAggregator extends ByteToMessageDecoder {
    private final static Logger logger = LoggerFactory.getLogger(NetconfEOMAggregator.class);

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        int index = indexOfSequence(in, NetconfMessageConstants.END_OF_MESSAGE);

From source file org.opendaylight.controller.netconf.util.handler.NetconfEXIToMessageDecoder.java

public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder {

    private static final Logger LOG = LoggerFactory.getLogger(NetconfEXIToMessageDecoder.class);

    //    private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance();

From source file org.opendaylight.controller.netconf.util.handler.NetconfMessageAggregator.java

public class NetconfMessageAggregator extends ByteToMessageDecoder {

    private final static Logger logger = LoggerFactory.getLogger(NetconfMessageAggregator.class);

    private byte[] eom = NetconfMessageConstants.endOfMessage;

From source file org.opendaylight.controller.netconf.util.handler.NetconfMessageChunkDecoder.java

public class NetconfMessageChunkDecoder extends ByteToMessageDecoder {

    private final static Logger logger = LoggerFactory.getLogger(NetconfMessageChunkDecoder.class);

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {

From source file org.opendaylight.controller.netconf.util.handler.NetconfXMLToHelloMessageDecoder.java

/**
 * Customized NetconfXMLToMessageDecoder that reads additional header with
 * session metadata from
 * {@link org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage}
 * . Used by netconf server to retrieve information about session metadata.
 */

From source file org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder.java

public final class NetconfXMLToMessageDecoder extends ByteToMessageDecoder {
    private static final Logger LOG = LoggerFactory.getLogger(NetconfXMLToMessageDecoder.class);

    @Override
    @VisibleForTesting
    public void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {

From source file org.opendaylight.groupbasedpolicy.jsonrpc.JsonRpcDecoder.java

/**
 * JSON RPC 1.0 compatible decoder capable of decoding JSON messages from a TCP stream.
 * The stream is framed first by inspecting the json for valid end marker (left curly)
 * and is passed to a Json parser (jackson) for converting into an object model.
 *
 * There are no JSON parsers that I am aware of that does non blocking parsing.

From source file org.opendaylight.netconf.nettyutil.handler.NetconfChunkAggregator.java

public class NetconfChunkAggregator extends ByteToMessageDecoder {
    private final static Logger LOG = LoggerFactory.getLogger(NetconfChunkAggregator.class);
    private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM = "Got byte {} while waiting for {}";
    private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM = "Got byte {} while waiting for {}-{}";
    public static final int DEFAULT_MAXIMUM_CHUNK_SIZE = 16 * 1024 * 1024;

From source file org.opendaylight.netconf.nettyutil.handler.NetconfEXIToMessageDecoder.java

public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder {

    private static final Logger LOG = LoggerFactory.getLogger(NetconfEXIToMessageDecoder.class);
    private static final SAXTransformerFactory FACTORY;
    static {
        final TransformerFactory f = SAXTransformerFactory.newInstance();