X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2Fhandler%2FNetconfEXIToMessageDecoder.java;h=0f85d18c16964be7b72b3d94fcb504f937e1a99d;hb=refs%2Fchanges%2F08%2F101608%2F2;hp=99d791642a5f9bf1ff5a1d560d2a79b7afb126a1;hpb=4753fa30e1d6127f8b01fef74bea187187fee4d7;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIToMessageDecoder.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIToMessageDecoder.java index 99d791642a..0f85d18c16 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIToMessageDecoder.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfEXIToMessageDecoder.java @@ -7,7 +7,8 @@ */ package org.opendaylight.netconf.nettyutil.handler; -import com.google.common.base.Preconditions; +import static java.util.Objects.requireNonNull; + import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.ByteBufUtil; @@ -24,9 +25,8 @@ import javax.xml.transform.dom.DOMResult; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; import org.opendaylight.netconf.api.NetconfMessage; +import org.opendaylight.netconf.shaded.exificient.core.exceptions.EXIException; import org.opendaylight.yangtools.util.xml.UntrustedXML; -import org.openexi.proc.common.EXIOptionsException; -import org.openexi.sax.EXIReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -53,21 +53,21 @@ public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { * which means that {@link #decode(ChannelHandlerContext, ByteBuf, List)} * cannot be invoked concurrently. Hence we can reuse the reader. */ - private final EXIReader reader; + private final ThreadLocalSAXDecoder reader; private final DocumentBuilder documentBuilder; - private NetconfEXIToMessageDecoder(final EXIReader reader) { - this.reader = Preconditions.checkNotNull(reader); + private NetconfEXIToMessageDecoder(final ThreadLocalSAXDecoder reader) { + this.reader = requireNonNull(reader); this.documentBuilder = UntrustedXML.newDocumentBuilder(); } - public static NetconfEXIToMessageDecoder create(final NetconfEXICodec codec) throws EXIOptionsException { + public static NetconfEXIToMessageDecoder create(final NetconfEXICodec codec) throws EXIException { return new NetconfEXIToMessageDecoder(codec.getReader()); } @Override protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List out) - throws EXIOptionsException, IOException, SAXException, TransformerConfigurationException { + throws IOException, SAXException, TransformerConfigurationException { /* * Note that we could loop here and process all the messages, but we can't do that. * The reason is operation, which has the contract of immediately stopping