Class AbstractNetconfSession<S extends org.opendaylight.netconf.api.NetconfSession,L extends org.opendaylight.netconf.api.NetconfSessionListener<S>>
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.SimpleChannelInboundHandler<Object>
-
- org.opendaylight.netconf.nettyutil.AbstractNetconfSession<S,L>
-
- 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNetconfSession(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 voidaddExiHandlers(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.voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg)voidclose()protected voidendOfInput()longgetSessionId()protected voidhandleMessage(org.opendaylight.netconf.api.NetconfMessage netconfMessage)voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx)booleanisUp()protected voidreplaceChannelHandler(String handlerName, io.netty.channel.ChannelHandler handler)protected voidreplaceMessageDecoder(io.netty.channel.ChannelHandler handler)protected voidreplaceMessageEncoder(io.netty.channel.ChannelHandler handler)protected voidreplaceMessageEncoderAfterNextMessage(io.netty.channel.ChannelHandler handler)io.netty.channel.ChannelFuturesendMessage(org.opendaylight.netconf.api.NetconfMessage netconfMessage)protected voidsessionUp()voidstartExiCommunication(org.opendaylight.netconf.api.NetconfMessage startExiMessage)protected abstract SthisInstance()StringtoString()-
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
-
-
-
-
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.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:
sendMessagein interfaceorg.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:
startExiCommunicationin interfaceorg.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 decoderencoder- EXI encoder
-
isUp
public final boolean isUp()
-
getSessionId
public final long getSessionId()
-
channelInactive
public final void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead0
protected final void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg)- Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<Object>
-
handlerAdded
public final void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
-