X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fhandler%2FNetconfEXICodec.java;h=a6e2e52ea5d2808bef21ce2f0aa08f59a1e0f2a4;hp=c28db18901eac433cee067d997e3afa33124eb63;hb=59a26f11e6f07d6b36aa820562ad00e367dcaa3b;hpb=7451e256fd9a658db243666bc7e734204519ceee diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java index c28db18901..a6e2e52ea5 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java @@ -1,7 +1,7 @@ package org.opendaylight.controller.netconf.util.handler; +import com.google.common.base.Preconditions; import org.openexi.proc.HeaderOptionsOutputType; -import org.openexi.proc.common.AlignmentType; import org.openexi.proc.common.EXIOptions; import org.openexi.proc.common.EXIOptionsException; import org.openexi.proc.common.GrammarOptions; @@ -9,20 +9,16 @@ import org.openexi.proc.grammars.GrammarCache; import org.openexi.sax.EXIReader; import org.openexi.sax.Transmogrifier; -import com.google.common.base.Preconditions; - -final class NetconfEXICodec { +public final class NetconfEXICodec { /** * NETCONF is XML environment, so the use of EXI cookie is not really needed. Adding it * decreases efficiency of encoding by adding human-readable 4 bytes "EXI$" to the head * of the stream. This is really useful, so let's output it now. */ private static final boolean OUTPUT_EXI_COOKIE = true; - private final AlignmentType alignmentType; private final EXIOptions exiOptions; - public NetconfEXICodec(final AlignmentType alignmentType, final EXIOptions exiOptions) { - this.alignmentType = Preconditions.checkNotNull(alignmentType); + public NetconfEXICodec(final EXIOptions exiOptions) { this.exiOptions = Preconditions.checkNotNull(exiOptions); } @@ -53,7 +49,7 @@ final class NetconfEXICodec { Transmogrifier getTransmogrifier() throws EXIOptionsException { final Transmogrifier transmogrifier = new Transmogrifier(); - transmogrifier.setAlignmentType(alignmentType); + transmogrifier.setAlignmentType(exiOptions.getAlignmentType()); transmogrifier.setBlockSize(exiOptions.getBlockSize()); transmogrifier.setGrammarCache(getGrammarCache()); transmogrifier.setOutputCookie(OUTPUT_EXI_COOKIE);