X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnettyutil%2Fhandler%2FNetconfMessageToXMLEncoder.java;h=99251b00d4a74786902eae9b43434a8d14e49915;hp=8ce9411cbd9c00ecf31639301454ac1f871b3179;hb=27a4009ad3e151118c6d76c5c4c0f56def4118d8;hpb=d5fcdd3416922d61f0bdebbe57e351456e3a3750 diff --git a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java index 8ce9411cbd..99251b00d4 100644 --- a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java +++ b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java @@ -17,21 +17,16 @@ import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Comment; public class NetconfMessageToXMLEncoder extends MessageToByteEncoder { private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageToXMLEncoder.class); - private static final TransformerFactory FACTORY = TransformerFactory.newInstance(); private final Optional clientId; @@ -39,14 +34,14 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoderabsent()); } - public NetconfMessageToXMLEncoder(Optional clientId) { + public NetconfMessageToXMLEncoder(final Optional clientId) { this.clientId = clientId; } @Override @VisibleForTesting - public void encode(ChannelHandlerContext ctx, NetconfMessage msg, ByteBuf out) throws IOException, TransformerException { - LOG.trace("Sent to encode : {}", XmlUtil.toString(msg.getDocument())); + public void encode(final ChannelHandlerContext ctx, final NetconfMessage msg, final ByteBuf out) throws IOException, TransformerException { + LOG.trace("Sent to encode : {}", msg); if (clientId.isPresent()) { Comment comment = msg.getDocument().createComment("clientId:" + clientId.get()); @@ -54,14 +49,10 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder