Class BGPSessionImpl

    • Method Detail

      • setChannelExtMsgCoder

        public void setChannelExtMsgCoder​(Open remoteOpen)
        Set the extend message coder for current channel. The reason for separating this part from constructor is, in #channel.pipeline().replace(..), the invokeChannelRead() will be invoked after the original message coder handler got removed. And there is chance that before the session instance is fully initiated (constructor returns), a KeepAlive message arrived already in the channel buffer. Thus #AbstractBGPSessionNegotiator.handleMessage(..) gets invoked again and a deadlock is caused. A BGP final state machine error will happen as BGP negotiator is still in OPEN_SENT state as the session constructor hasn't returned yet.
      • closeWithoutMessage

        public void closeWithoutMessage()
        Description copied from interface: BGPSession
        Close peer session without sending Notification message.
        Specified by:
        closeWithoutMessage in interface BGPSession
      • addToStringAttributes

        protected com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes​(com.google.common.base.MoreObjects.ToStringHelper toStringHelper)
      • getAdvertisedTableTypes

        public Set<BgpTableType> getAdvertisedTableTypes()
        Description copied from interface: BGPSession
        Return the list of tables which the peer has advertised to support.
        Specified by:
        getAdvertisedTableTypes in interface BGPSession
        Returns:
        Set of tables which it supports.
      • getAdvertisedGracefulRestartCapability

        public GracefulRestartCapability getAdvertisedGracefulRestartCapability()
        Description copied from interface: BGPSession
        Return advertised graceful capability containing the list of tables which the peer has advertised to support, restart time and restarting flags.
        Specified by:
        getAdvertisedGracefulRestartCapability in interface BGPSession
        Returns:
        Advertised graceful restart capability.
      • getAdvertisedLlGracefulRestartCapability

        public LlGracefulRestartCapability getAdvertisedLlGracefulRestartCapability()
        Description copied from interface: BGPSession
        Return advertised long-lived graceful capability containing the list of tables with stale time which the peer has advertised to support.
        Specified by:
        getAdvertisedLlGracefulRestartCapability in interface BGPSession
        Returns:
        Advertised long-lived graceful restart capability.
      • getState

        public State getState()
      • getBgpId

        public final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address getBgpId()
        Description copied from interface: BGPSession
        Return the BGP router ID advertised by the peer.
        Specified by:
        getBgpId in interface BGPSession
        Returns:
        Peer's BGP Router ID.
      • getAsNumber

        public final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber getAsNumber()
        Description copied from interface: BGPSession
        Return the AS number which the peer advertises.
        Specified by:
        getAsNumber in interface BGPSession
        Returns:
        Peer's AS Number
      • 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.yangtools.yang.binding.Notification msg)
        Specified by:
        channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<org.opendaylight.yangtools.yang.binding.Notification>
      • 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
      • schedule

        public io.netty.util.concurrent.ScheduledFuture<?> schedule​(Runnable command,
                                                                    long delay,
                                                                    TimeUnit unit)
        Description copied from interface: BGPSession
        Schedule a task to be executed in the context of the session handling thread.
        Specified by:
        schedule in interface BGPSession
        Parameters:
        command - the task to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        Returns:
        Future representing the scheduled task.