2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.netconf.impl.mapping;
\r
10 import io.netty.buffer.ByteBuf;
\r
11 import io.netty.channel.ChannelHandlerContext;
\r
12 import io.netty.handler.codec.ByteToMessageDecoder;
\r
14 import java.util.List;
\r
16 import org.opendaylight.controller.netconf.util.xml.ExiParameters;
\r
17 import org.opendaylight.controller.netconf.util.xml.ExiUtil;
\r
18 import org.slf4j.Logger;
\r
19 import org.slf4j.LoggerFactory;
\r
21 public class ExiDecoderHandler extends ByteToMessageDecoder {
\r
23 public static final String HANDLER_NAME;
\r
26 HANDLER_NAME = "exiDecoder";
\r
29 private final static Logger logger = LoggerFactory
\r
30 .getLogger(ExiDecoderHandler.class);
\r
32 private ExiParameters parameters;
\r
34 public ExiDecoderHandler(ExiParameters parameters) {
\r
35 this.parameters = parameters;
\r
39 protected void decode(ChannelHandlerContext ctx, ByteBuf in,
\r
42 ExiUtil.decode(in, out, this.parameters);
\r
43 } catch (Exception e) {
\r
44 throw new IllegalStateException("Unable to decode exi message.");
\r