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 Type
    Method
    Description
    final void
    channelInactive(io.netty.channel.ChannelHandlerContext ctx)
     
    protected final void
    channelRead0(io.netty.channel.ChannelHandlerContext ctx, Message msg)
     
    void
    Closes PCEP session without sending a Close message, as the channel is no longer active.
    void
    Closes PCEP session, cancels all timers, returns to state Idle, sends the Close Message.
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    final Integer
     
    final Integer
     
    The 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.
    void
    Handles incoming message.
    final void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
     
    boolean
     
    io.netty.util.concurrent.Future<Void>
    Sends message to serialization.
    final String
     

    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 class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerRemoved

    Methods inherited from interface org.opendaylight.protocol.pcep.PCEPSession

    localSessionCharacteristics
  • Method Details

    • getKeepAliveTimerValue

      public final Integer getKeepAliveTimerValue()
    • getDeadTimerValue

      public final Integer getDeadTimerValue()
    • sendMessage

      public io.netty.util.concurrent.Future<Void> sendMessage(Message msg)
      Sends message to serialization.
      Specified by:
      sendMessage in interface PCEPSession
      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:
      close in interface AutoCloseable
    • close

      public void close(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 PCEPSession
    • getRemoteTlvs

      public Tlvs getRemoteTlvs()
      Description copied from interface: PCEPSession
      Returns session characteristics of the remote PCEP Speaker.
      Specified by:
      getRemoteTlvs in interface PCEPSession
      Returns:
      Open message TLVs
    • getRemoteAddress

      public InetAddress getRemoteAddress()
      Description copied from interface: PCEPSession
      Returns remote address.
      Specified by:
      getRemoteAddress in interface PCEPSession
      Returns:
      inet address
    • handleMessage

      public void handleMessage(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

      public final String toString()
      Overrides:
      toString in class Object
    • getMessages

      public Messages getMessages()
      Description copied from interface: PCEPSessionState
      The statistics of PCEP received/sent messages from the PCE point of view.
      Specified by:
      getMessages in interface PCEPSessionState
      Returns:
      messages
    • getLocalPref

      public LocalPref getLocalPref()
      Description copied from interface: PCEPSessionState
      The local (PCE) preferences.
      Specified by:
      getLocalPref in interface PCEPSessionState
      Returns:
      local preferences
    • getPeerPref

      public PeerPref getPeerPref()
      Description copied from interface: PCEPSessionState
      The remote peer (PCC) preferences.
      Specified by:
      getPeerPref in interface PCEPSessionState
      Returns:
      peer preferences
    • getLocalOpen

      public Open getLocalOpen()
      Description copied from interface: PCEPSessionState
      The local (PCE) Open Message.
      Specified by:
      getLocalOpen in interface PCEPSessionState
      Returns:
      Open
    • 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, Message msg)
      Specified by:
      channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<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 Tlvs getLocalTlvs()
      Description copied from interface: PCEPSession
      Returns session characteristics of the local PCEP Speaker.
      Specified by:
      getLocalTlvs in interface PCEPSession
      Returns:
      Open message TLVs