Class AbstractTopologySessionListener

  • All Implemented Interfaces:
    EventListener, TopologySessionStats, PCEPSessionListener

    public abstract class AbstractTopologySessionListener
    extends Object
    implements TopologySessionStats
    Base class for PCEP topology providers. It handles the common tasks involved in managing a PCEP server (PCE) endpoint, and exposing a network topology based on it. It needs to be subclassed to form a fully functional block, where the subclass provides handling of incoming messages.
    • Method Detail

      • onSessionUp

        public final void onSessionUp​(PCEPSession psession)
        Description copied from interface: PCEPSessionListener
        Fired when the session was established successfully.
        Specified by:
        onSessionUp in interface PCEPSessionListener
        psession - Peer address families which we accepted
      • onSessionDown

        public final void onSessionDown​(PCEPSession psession,
                                        Exception exception)
        Description copied from interface: PCEPSessionListener
        Fired when the session went down because of an IO error. Implementation should take care of closing underlying session.
        Specified by:
        onSessionDown in interface PCEPSessionListener
        psession - that went down
        exception - Exception that was thrown as the cause of session being down
      • onSessionTerminated

        public final void onSessionTerminated​(PCEPSession psession,
                                              PCEPTerminationReason reason)
        Description copied from interface: PCEPSessionListener
        Fired when the session is terminated locally. The session has already been closed and transitioned to IDLE state. Any outstanding queued messages were not sent. The user should not attempt to make any use of the session.
        Specified by:
        onSessionTerminated in interface PCEPSessionListener
        reason - the cause why the session went down
      • onMessage

        protected abstract boolean onMessage​(org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.MessageContext ctx,
                                             Message message)
        Perform revision-specific message processing when a message arrives.
        ctx - Message processing context
        message - Protocol message
        True if the message type is not handle.
      • close

        public void close()
      • updateLsp

        protected final void updateLsp​(org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.MessageContext ctx,
                                       PlspId id,
                                       String lspName,
                                       ReportedLspBuilder rlb,
                                       boolean solicited,
                                       boolean remove)
        Update an LSP in the data store.
        ctx - Message context
        id - Revision-specific LSP identifier
        lspName - LSP name
        rlb - Reported LSP builder
        solicited - True if the update was solicited
        remove - True if this is an LSP path removal
      • stateSynchronizationAchieved

        protected final void stateSynchronizationAchieved​(org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.MessageContext ctx)
        Indicate that the peer has completed state synchronization.
        ctx - Message context
      • updatePccNode

        protected final void updatePccNode​(org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.MessageContext ctx,
                                           PathComputationClient pcc)
      • lspIdentifier

        protected final @NonNull org.opendaylight.yangtools.yang.binding.InstanceIdentifier<ReportedLsp> lspIdentifier​(String name)
      • removeLsp

        protected final void removeLsp​(org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.MessageContext ctx,
                                       PlspId id)
        Remove LSP from the database.
        ctx - Message Context
        id - Revision-specific LSP identifier
      • loadLspData

        protected abstract void loadLspData​( node,
                                            Map<String,​ReportedLsp> lspData,
                                            Map<PlspId,​String> lsps,
                                            boolean incrementalSynchro)
      • isSynchronized

        protected final boolean isSynchronized()
      • tearDownSession

        public<org.opendaylight.yangtools.yang.common.RpcResult<Void>> tearDownSession​(TearDownSessionInput input)
      • addLsp

        public abstract @NonNull<OperationResult> addLsp​(AddLspArgs input)
      • removeLsp

        public abstract @NonNull<OperationResult> removeLsp​(RemoveLspArgs input)
      • updateLsp

        public abstract @NonNull<OperationResult> updateLsp​(UpdateLspArgs input)