Class 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      protected void channelRead0​(io.netty.channel.ChannelHandlerContext ctx, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg)  
      void close()
      Closes PCEP session without sending a Close message, as the channel is no longer active.
      void close​(org.opendaylight.protocol.pcep.TerminationReason reason)
      Closes PCEP session, cancels all timers, returns to state Idle, sends the Close Message.
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)  
      Integer getDeadTimerValue()  
      Integer getKeepAliveTimerValue()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open getLocalOpen()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.LocalPref getLocalPref()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs getLocalTlvs()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.Messages getMessages()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.PeerPref getPeerPref()  
      InetAddress getRemoteAddress()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs getRemoteTlvs()  
      void handleMessage​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message msg)
      Handles incoming message.
      void handlerAdded​(io.netty.channel.ChannelHandlerContext ctx)  
      boolean isClosed()  
      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.
      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, 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.protocol.pcep.PCEPSession

        localSessionCharacteristics
    • Method Detail

      • getKeepAliveTimerValue

        public final Integer getKeepAliveTimerValue()
      • getDeadTimerValue

        public final Integer 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:
        sendMessage in interface org.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:
        close in interface AutoCloseable
      • 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:
        close in interface org.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:
        getRemoteTlvs in interface org.opendaylight.protocol.pcep.PCEPSession
      • getRemoteAddress

        public InetAddress getRemoteAddress()
        Specified by:
        getRemoteAddress in interface org.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
      • getMessages

        public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.Messages getMessages()
        Specified by:
        getMessages in interface org.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:
        getLocalPref in interface org.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:
        getPeerPref in interface org.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:
        getLocalOpen in interface org.opendaylight.protocol.pcep.PCEPSessionState
      • channelInactive

        public final void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
                                   throws Exception
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class io.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:
        channelRead0 in class io.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:
        handlerAdded in interface io.netty.channel.ChannelHandler
        Overrides:
        handlerAdded in class io.netty.channel.ChannelHandlerAdapter
      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    Throwable cause)
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelHandler
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        exceptionCaught in class io.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:
        getLocalTlvs in interface org.opendaylight.protocol.pcep.PCEPSession