X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fclient%2FNetconfClientSession.java;h=31a7661b2c17ccb8fdff3688f7111a26b4fe3f97;hp=004a22f6948c570e96fc880ea764b366c8cbfd94;hb=24723fb6aa97d615d2939a9791b33b33205ceee7;hpb=3a826be203c89413a1001d80e508e18dca9d7f45 diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java index 004a22f694..31a7661b2c 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java @@ -9,11 +9,11 @@ package org.opendaylight.controller.netconf.client; import io.netty.channel.Channel; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.MessageToByteEncoder; import java.util.Collection; +import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession; -import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXICodec; -import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXIToMessageDecoder; -import org.opendaylight.controller.netconf.nettyutil.handler.NetconfMessageToEXIEncoder; import org.opendaylight.controller.netconf.nettyutil.handler.NetconfMessageToXMLEncoder; import org.opendaylight.controller.netconf.nettyutil.handler.NetconfXMLToMessageDecoder; import org.slf4j.Logger; @@ -21,14 +21,22 @@ import org.slf4j.LoggerFactory; public class NetconfClientSession extends AbstractNetconfSession { - private static final Logger logger = LoggerFactory.getLogger(NetconfClientSession.class); + private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSession.class); private final Collection capabilities; - public NetconfClientSession(NetconfClientSessionListener sessionListener, Channel channel, long sessionId, - Collection capabilities) { + /** + * Construct a new session. + * + * @param sessionListener + * @param channel + * @param sessionId + * @param capabilities set of advertised capabilities. Expected to be immutable. + */ + public NetconfClientSession(final NetconfClientSessionListener sessionListener, final Channel channel, final long sessionId, + final Collection capabilities) { super(sessionListener, channel, sessionId); this.capabilities = capabilities; - logger.debug("Client Session {} created", toString()); + LOG.debug("Client Session {} created", this); } public Collection getServerCapabilities() { @@ -41,10 +49,10 @@ public class NetconfClientSession extends AbstractNetconfSession encoder) { // TODO used only in negotiator, client supports only auto start-exi - replaceMessageDecoder(new NetconfEXIToMessageDecoder(exiCodec)); - replaceMessageEncoder(new NetconfMessageToEXIEncoder(exiCodec)); + replaceMessageDecoder(decoder); + replaceMessageEncoder(encoder); } @Override