Class AbstractNetconfSession<S extends org.opendaylight.netconf.api.NetconfSession,​L extends org.opendaylight.netconf.api.NetconfSessionListener<S>>

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, Closeable, AutoCloseable, org.opendaylight.netconf.api.NetconfExiSession, org.opendaylight.netconf.api.NetconfSession

    public abstract class AbstractNetconfSession<S extends org.opendaylight.netconf.api.NetconfSession,​L extends org.opendaylight.netconf.api.NetconfSessionListener<S>>
    extends io.netty.channel.SimpleChannelInboundHandler<Object>
    implements org.opendaylight.netconf.api.NetconfSession, org.opendaylight.netconf.api.NetconfExiSession
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractNetconfSession​(L sessionListener, io.netty.channel.Channel channel, long sessionId)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void addExiHandlers​(io.netty.handler.codec.ByteToMessageDecoder decoder, io.netty.handler.codec.MessageToByteEncoder<org.opendaylight.netconf.api.NetconfMessage> encoder)
      Add a set encoder/decoder tuple into the channel pipeline as appropriate.
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      protected void channelRead0​(io.netty.channel.ChannelHandlerContext ctx, Object msg)  
      void close()  
      protected void endOfInput()  
      long getSessionId()  
      protected void handleMessage​(org.opendaylight.netconf.api.NetconfMessage netconfMessage)  
      void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)  
      boolean isUp()  
      protected void replaceChannelHandler​(String handlerName, io.netty.channel.ChannelHandler handler)  
      protected void replaceMessageDecoder​(io.netty.channel.ChannelHandler handler)  
      protected void replaceMessageEncoder​(io.netty.channel.ChannelHandler handler)  
      protected void replaceMessageEncoderAfterNextMessage​(io.netty.channel.ChannelHandler handler)  
      io.netty.channel.ChannelFuture sendMessage​(org.opendaylight.netconf.api.NetconfMessage netconfMessage)  
      protected void sessionUp()  
      void startExiCommunication​(org.opendaylight.netconf.api.NetconfMessage startExiMessage)  
      protected abstract S thisInstance()  
      String toString()  
      • Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

        acceptInboundMessage, channelRead
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerRemoved, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerRemoved
      • Methods inherited from interface org.opendaylight.netconf.api.NetconfExiSession

        stopExiCommunication
    • Constructor Detail

      • AbstractNetconfSession

        protected AbstractNetconfSession​(L sessionListener,
                                         io.netty.channel.Channel channel,
                                         long sessionId)
    • Method Detail

      • thisInstance

        protected abstract S thisInstance()
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.opendaylight.netconf.api.NetconfSession
      • handleMessage

        protected void handleMessage​(org.opendaylight.netconf.api.NetconfMessage netconfMessage)
      • sendMessage

        public io.netty.channel.ChannelFuture sendMessage​(org.opendaylight.netconf.api.NetconfMessage netconfMessage)
        Specified by:
        sendMessage in interface org.opendaylight.netconf.api.NetconfSession
      • endOfInput

        protected void endOfInput()
      • sessionUp

        protected void sessionUp()
      • replaceMessageDecoder

        protected final void replaceMessageDecoder​(io.netty.channel.ChannelHandler handler)
      • replaceMessageEncoder

        protected final void replaceMessageEncoder​(io.netty.channel.ChannelHandler handler)
      • replaceMessageEncoderAfterNextMessage

        protected final void replaceMessageEncoderAfterNextMessage​(io.netty.channel.ChannelHandler handler)
      • replaceChannelHandler

        protected final void replaceChannelHandler​(String handlerName,
                                                   io.netty.channel.ChannelHandler handler)
      • startExiCommunication

        public final void startExiCommunication​(org.opendaylight.netconf.api.NetconfMessage startExiMessage)
        Specified by:
        startExiCommunication in interface org.opendaylight.netconf.api.NetconfExiSession
      • addExiHandlers

        protected abstract void addExiHandlers​(io.netty.handler.codec.ByteToMessageDecoder decoder,
                                               io.netty.handler.codec.MessageToByteEncoder<org.opendaylight.netconf.api.NetconfMessage> encoder)
        Add a set encoder/decoder tuple into the channel pipeline as appropriate.
        Parameters:
        decoder - EXI decoder
        encoder - EXI encoder
      • isUp

        public final boolean isUp()
      • getSessionId

        public final long getSessionId()
      • channelInactive

        public final void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
      • channelRead0

        protected final void channelRead0​(io.netty.channel.ChannelHandlerContext ctx,
                                          Object msg)
        Specified by:
        channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<Object>
      • handlerAdded

        public final void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)
        Specified by:
        handlerAdded in interface io.netty.channel.ChannelHandler
        Overrides:
        handlerAdded in class io.netty.channel.ChannelHandlerAdapter