Class PCEPSessionImpl
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message>
org.opendaylight.protocol.pcep.impl.PCEPSessionImpl
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,AutoCloseable,org.opendaylight.protocol.pcep.PCEPSession,org.opendaylight.protocol.pcep.PCEPSessionState
public class PCEPSessionImpl
extends io.netty.channel.SimpleChannelInboundHandler<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message>
implements org.opendaylight.protocol.pcep.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, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg) voidclose()Closes PCEP session without sending a Close message, as the channel is no longer active.voidclose(org.opendaylight.protocol.pcep.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 @org.checkerframework.checker.index.qual.NonNegative shortfinal @org.checkerframework.checker.index.qual.NonNegative shortorg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Openorg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.LocalPreforg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvsorg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.Messagesorg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.PeerPreforg.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsvoidhandleMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg) Handles incoming message.final voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) booleanisClosed()io.netty.util.concurrent.Future<Void>sendMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.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
public final @org.checkerframework.checker.index.qual.NonNegative short getKeepAliveTimerValue() -
getDeadTimerValue
public final @org.checkerframework.checker.index.qual.NonNegative short getDeadTimerValue() -
sendMessage
public io.netty.util.concurrent.Future<Void> sendMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg) Sends message to serialization.- Specified by:
sendMessagein interfaceorg.opendaylight.protocol.pcep.PCEPSession- Parameters:
msg- to be sent
-
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- Specified by:
closein interfaceorg.opendaylight.protocol.pcep.PCEPSession
-
close
public void close(org.opendaylight.protocol.pcep.TerminationReason reason) 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 interfaceorg.opendaylight.protocol.pcep.PCEPSession
-
getRemoteTlvs
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs getRemoteTlvs()- Specified by:
getRemoteTlvsin interfaceorg.opendaylight.protocol.pcep.PCEPSession
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceorg.opendaylight.protocol.pcep.PCEPSession
-
handleMessage
public void handleMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg) 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
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.Messages getMessages()- Specified by:
getMessagesin interfaceorg.opendaylight.protocol.pcep.PCEPSessionState
-
getLocalPref
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.LocalPref getLocalPref()- Specified by:
getLocalPrefin interfaceorg.opendaylight.protocol.pcep.PCEPSessionState
-
getPeerPref
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.PeerPref getPeerPref()- Specified by:
getPeerPrefin interfaceorg.opendaylight.protocol.pcep.PCEPSessionState
-
getLocalOpen
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open getLocalOpen()- Specified by:
getLocalOpenin interfaceorg.opendaylight.protocol.pcep.PCEPSessionState
-
channelInactive
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelRead0
protected final void channelRead0(io.netty.channel.ChannelHandlerContext ctx, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg) - Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.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
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs getLocalTlvs()- Specified by:
getLocalTlvsin interfaceorg.opendaylight.protocol.pcep.PCEPSession
-