Class PCEPSessionImpl
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Message>
org.opendaylight.protocol.pcep.impl.PCEPSessionImpl
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,AutoCloseable,PCEPSession,PCEPSessionState
public class PCEPSessionImpl
extends io.netty.channel.SimpleChannelInboundHandler<Message>
implements PCEPSession
Implementation of PCEPSession. (Not final for testing.)
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Method Summary
Modifier and TypeMethodDescriptionfinal voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) protected final voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, Message msg) voidclose()Closes PCEP session without sending a Close message, as the channel is no longer active.voidclose(TerminationReason reason) Closes PCEP session, cancels all timers, returns to state Idle, sends the Close Message.voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) final Integerfinal IntegerThe local (PCE) Open Message.The local (PCE) preferences.Returns session characteristics of the local PCEP Speaker.The statistics of PCEP received/sent messages from the PCE point of view.The remote peer (PCC) preferences.Returns remote address.Returns session characteristics of the remote PCEP Speaker.voidhandleMessage(Message msg) Handles incoming message.final voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) booleanisClosed()io.netty.util.concurrent.Future<Void>sendMessage(Message msg) Sends message to serialization.final StringtoString()Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemovedMethods inherited from interface org.opendaylight.protocol.pcep.PCEPSession
localSessionCharacteristics
-
Method Details
-
getKeepAliveTimerValue
-
getDeadTimerValue
-
sendMessage
Sends message to serialization.- Specified by:
sendMessagein interfacePCEPSession- Parameters:
msg- to be sent- Returns:
- Future promise which will be succeed when the message is enqueued in the socket.
-
isClosed
public boolean isClosed() -
close
public void close()Closes PCEP session without sending a Close message, as the channel is no longer active.- Specified by:
closein interfaceAutoCloseable
-
close
Closes PCEP session, cancels all timers, returns to state Idle, sends the Close Message. KeepAlive and DeadTimer are cancelled if the state of the session changes to IDLE. This method is used to close the PCEP session from inside the session or from the listener, therefore the parent of this session should be informed.- Specified by:
closein interfacePCEPSession
-
getRemoteTlvs
Description copied from interface:PCEPSessionReturns session characteristics of the remote PCEP Speaker.- Specified by:
getRemoteTlvsin interfacePCEPSession- Returns:
- Open message TLVs
-
getRemoteAddress
Description copied from interface:PCEPSessionReturns remote address.- Specified by:
getRemoteAddressin interfacePCEPSession- Returns:
- inet address
-
handleMessage
Handles incoming message. If the session is up, it notifies the user. The user is notified about every message except KeepAlive.- Parameters:
msg- incoming message
-
toString
-
getMessages
Description copied from interface:PCEPSessionStateThe statistics of PCEP received/sent messages from the PCE point of view.- Specified by:
getMessagesin interfacePCEPSessionState- Returns:
- messages
-
getLocalPref
Description copied from interface:PCEPSessionStateThe local (PCE) preferences.- Specified by:
getLocalPrefin interfacePCEPSessionState- Returns:
- local preferences
-
getPeerPref
Description copied from interface:PCEPSessionStateThe remote peer (PCC) preferences.- Specified by:
getPeerPrefin interfacePCEPSessionState- Returns:
- peer preferences
-
getLocalOpen
Description copied from interface:PCEPSessionStateThe local (PCE) Open Message.- Specified by:
getLocalOpenin interfacePCEPSessionState- Returns:
- Open
-
channelInactive
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelRead0
- Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<Message>
-
handlerAdded
public final void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
getLocalTlvs
Description copied from interface:PCEPSessionReturns session characteristics of the local PCEP Speaker.- Specified by:
getLocalTlvsin interfacePCEPSession- Returns:
- Open message TLVs
-