Class BGPPeer
- java.lang.Object
-
- org.opendaylight.protocol.bgp.rib.DefaultRibReference
-
- org.opendaylight.protocol.bgp.rib.impl.state.BGPPeerStateImpl
-
- org.opendaylight.protocol.bgp.rib.impl.BGPPeer
-
- All Implemented Interfaces:
EventListener,org.opendaylight.mdsal.dom.api.DOMTransactionChainListener,BGPMessagesListener,PeerTransactionChain,RibReference,BGPSessionListener,Peer,PeerRPCs,PeerTrackerInformation,BGPRouteEntryImportParameters,RouteTargetMembershipConsumer,BGPAfiSafiState,BGPErrorHandlingState,BGPGracelfulRestartState,BGPLlGracelfulRestartState,BGPPeerMessagesState,BGPPeerState,BGPPeerStateProvider,InstanceReference<Rib>
public class BGPPeer extends BGPPeerStateImpl implements BGPSessionListener
Class representing a peer. We have a single instance for each peer, which provides translation from BGP events into RIB actions.
-
-
Constructor Summary
Constructors Constructor Description BGPPeer(BGPTableTypeRegistryConsumer tableTypeRegistry, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone neighborAddress, String peerGroupName, RIB rib, PeerRole role, ClusterIdentifier clusterId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber localAs, org.opendaylight.mdsal.binding.api.RpcProviderService rpcRegistry, Set<TablesKey> afiSafisAdvertized, Set<TablesKey> afiSafisGracefulAdvertized, Map<TablesKey,Integer> llGracefulTablesAdvertised, BgpPeer bgpPeer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo>close()Close Peers and performs asynchronously DS clean up.BGPAfiSafiStategetBGPAfiSafiState()Afi Safi Operational State.BGPErrorHandlingStategetBGPErrorHandlingState()Error Handling State.BGPSessionStategetBGPSessionState()BGP Session Operational State.BGPTimersStategetBGPTimersState()BGP Operation Timers State.BGPTransportStategetBGPTransportState()BGP Operational Transport State.ClusterIdentifiergetClusterId()Returns Cluster Id.org.opendaylight.mdsal.dom.api.DOMTransactionChaingetDomChain()Returns Peer DOMTransactionChain.ClusterIdentifiergetFromClusterId()Peer id of Peer route entry announcer.PeerIdgetFromPeerId()Peer id of Peer route entry announcer.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumbergetFromPeerLocalAs()Peer local AS of route entry announcer.PeerRolegetFromPeerRole()Peer id of Peer route entry announcer.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumbergetLocalAs()Returns Local AS.List<RouteTarget>getMemberships()Returns list of Route target advertized per Peer.StringgetName()Return peer's symbolic name.PeerIdgetPeerId()Returns Peer id.org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifiergetRibOutIId(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablekey)Creates Table Adj Rib Out Instance identifier.PeerRolegetRole()Returns Peer Role.SendReceivegetSupportedAddPathTables(TablesKey tableKey)Returns AddPath support configuration if supported, otherwise null.<C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>>
voidinitializeRibOut(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C,S>> routesToStore)Stores under peers rib Out already present routes, before proceed to process any new route advertizement.voidinstantiateServiceInstance()voidmarkUptodate(TablesKey tablesKey)Marks synchronization finished for given Table key.voidonMessage(BGPSession session, org.opendaylight.yangtools.yang.binding.Notification<?> msg)Fired when a normal protocol message is received.voidonSessionDown(BGPSession session, Exception exc)Fired when the session went down because of an IO error.voidonSessionTerminated(BGPSession session, BGPTerminationReason cause)Fired when the session is terminated locally.voidonSessionUp(BGPSession session)Fired when the session was established successfully.voidonTransactionChainFailed(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain, org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction transaction, Throwable cause)voidonTransactionChainSuccessful(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain)<C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>>
voidreEvaluateAdvertizement(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C,S>> routesToStore)Applies all policies through all present routes, and advertize/withdraws based on new results.<C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>>
voidrefreshRibOut(RouteEntryDependenciesContainer entryDep, List<StaleBestPathRoute> staleRoutes, List<AdvertizedRoute<C,S>> newRoutes)Update peers ribout after path selection processing.com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo>releaseConnection()Release Peer session.com.google.common.util.concurrent.ListenableFuture<?>restartGracefully(long selectionDeferralTimerSeconds)Perform graceful restart.booleansupportsTable(TablesKey tableKey)Returns true if we have advertized support for a table, i.e.StringtoString()-
Methods inherited from class org.opendaylight.protocol.bgp.rib.impl.state.BGPPeerStateImpl
getAfiSafisAdvertized, getAfiSafisReceived, getBGPGracelfulRestart, getBGPPeerMessagesState, getErroneousUpdateReceivedCount, getGroupId, getLlGracefulRestartTimer, getMode, getNeighborAddress, getNotificationMessagesReceivedCount, getNotificationMessagesSentCount, getPeerRestartTime, getPeerState, getPrefixesInstalledCount, getPrefixesReceivedCount, getPrefixesSentCount, getTotalPrefixes, getUpdateMessagesReceivedCount, getUpdateMessagesSentCount, isActive, isAfiSafiSupported, isGracefulRestartAdvertized, isGracefulRestartReceived, isLlGracefulRestartAdvertised, isLlGracefulRestartReceived, isLocalRestarting, isPeerRestarting, messageReceived, messageSent, registerPrefixesCounters, registerPrefixesSentCounter, resetState, setActive, setAdvertizedGracefulRestartTableTypes, setAdvertizedLlGracefulRestartTableTypes, setAfiSafiGracefulRestartState, setLocalRestartingState, setRestartingState
-
Methods inherited from class org.opendaylight.protocol.bgp.rib.DefaultRibReference
getInstanceIdentifier
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState
getTotalPathsCount
-
Methods inherited from interface org.opendaylight.protocol.bgp.rib.spi.PeerTrackerInformation
supportsAddPathSupported
-
Methods inherited from interface org.opendaylight.protocol.bgp.rib.RibReference
getInstanceIdentifier
-
-
-
-
Constructor Detail
-
BGPPeer
public BGPPeer(BGPTableTypeRegistryConsumer tableTypeRegistry, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone neighborAddress, String peerGroupName, RIB rib, PeerRole role, ClusterIdentifier clusterId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber localAs, org.opendaylight.mdsal.binding.api.RpcProviderService rpcRegistry, Set<TablesKey> afiSafisAdvertized, Set<TablesKey> afiSafisGracefulAdvertized, Map<TablesKey,Integer> llGracefulTablesAdvertised, BgpPeer bgpPeer)
-
-
Method Detail
-
instantiateServiceInstance
public void instantiateServiceInstance()
-
close
public com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo> close()
Description copied from interface:PeerClose Peers and performs asynchronously DS clean up.
-
onMessage
public void onMessage(BGPSession session, org.opendaylight.yangtools.yang.binding.Notification<?> msg) throws BGPDocumentedException
Description copied from interface:BGPSessionListenerFired when a normal protocol message is received.- Specified by:
onMessagein interfaceBGPSessionListenermsg- Protocol message- Throws:
BGPDocumentedException
-
onSessionUp
public void onSessionUp(BGPSession session)
Description copied from interface:BGPSessionListenerFired when the session was established successfully.- Specified by:
onSessionUpin interfaceBGPSessionListener- Parameters:
session- Peer address families which we accepted
-
onSessionDown
public void onSessionDown(BGPSession session, Exception exc)
Description copied from interface:BGPSessionListenerFired when the session went down because of an IO error. Implementation should take care of closing underlying session.- Specified by:
onSessionDownin interfaceBGPSessionListener- Parameters:
session- that went downexc- Exception that was thrown as the cause of session being down
-
onSessionTerminated
public void onSessionTerminated(BGPSession session, BGPTerminationReason cause)
Description copied from interface:BGPSessionListenerFired 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:
onSessionTerminatedin interfaceBGPSessionListenercause- the cause why the session went down
-
releaseConnection
public com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo> releaseConnection()
Description copied from interface:PeerRPCsRelease Peer session.- Specified by:
releaseConnectionin interfacePeerRPCs
-
getSupportedAddPathTables
public SendReceive getSupportedAddPathTables(TablesKey tableKey)
Description copied from interface:PeerTrackerInformationReturns AddPath support configuration if supported, otherwise null.- Specified by:
getSupportedAddPathTablesin interfacePeerTrackerInformation- Parameters:
tableKey- table- Returns:
- AddPath support configuration if supported, otherwise null
-
supportsTable
public boolean supportsTable(TablesKey tableKey)
Description copied from interface:PeerTrackerInformationReturns true if we have advertized support for a table, i.e. any prefix from this table should be subject to export towards the peer.- Specified by:
supportsTablein interfacePeerTrackerInformation- Parameters:
tableKey- table- Returns:
- true if the table is being advertized to the peer.
-
getRibOutIId
public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier getRibOutIId(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablekey)
Description copied from interface:PeerTrackerInformationCreates Table Adj Rib Out Instance identifier.- Specified by:
getRibOutIIdin interfacePeerTrackerInformation- Parameters:
tablekey- table key- Returns:
- instance identifier.
-
onTransactionChainFailed
public void onTransactionChainFailed(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain, org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction transaction, Throwable cause)- Specified by:
onTransactionChainFailedin interfaceorg.opendaylight.mdsal.dom.api.DOMTransactionChainListener
-
markUptodate
public void markUptodate(TablesKey tablesKey)
Description copied from interface:BGPSessionListenerMarks synchronization finished for given Table key.- Specified by:
markUptodatein interfaceBGPSessionListener- Parameters:
tablesKey- of the table where synchronization finished
-
getBGPSessionState
public BGPSessionState getBGPSessionState()
Description copied from interface:BGPPeerStateBGP Session Operational State.- Specified by:
getBGPSessionStatein interfaceBGPPeerState- Returns:
- BGPSessionState
-
getBGPTimersState
public BGPTimersState getBGPTimersState()
Description copied from interface:BGPPeerStateBGP Operation Timers State.- Specified by:
getBGPTimersStatein interfaceBGPPeerState- Returns:
- BGPTimersState
-
getBGPTransportState
public BGPTransportState getBGPTransportState()
Description copied from interface:BGPPeerStateBGP Operational Transport State.- Specified by:
getBGPTransportStatein interfaceBGPPeerState- Returns:
- BGPTransportState
-
getMemberships
public List<RouteTarget> getMemberships()
Description copied from interface:RouteTargetMembershipConsumerReturns list of Route target advertized per Peer.- Specified by:
getMembershipsin interfaceRouteTargetMembershipConsumer
-
restartGracefully
public com.google.common.util.concurrent.ListenableFuture<?> restartGracefully(long selectionDeferralTimerSeconds)
Description copied from interface:PeerRPCsPerform graceful restart. Wait with route selection until EOR is received or selection-deferral-timer expires.- Specified by:
restartGracefullyin interfacePeerRPCs- Parameters:
selectionDeferralTimerSeconds- time to wait in seconds
-
getPeerId
public final PeerId getPeerId()
Description copied from interface:PeerTrackerInformationReturns Peer id.- Specified by:
getPeerIdin interfacePeerTrackerInformation- Returns:
- PeerID
-
getRole
public final PeerRole getRole()
Description copied from interface:PeerTrackerInformationReturns Peer Role.- Specified by:
getRolein interfacePeerTrackerInformation- Returns:
- PeerRole
-
getFromPeerRole
public final PeerRole getFromPeerRole()
Description copied from interface:BGPRouteEntryImportParametersPeer id of Peer route entry announcer.- Specified by:
getFromPeerRolein interfaceBGPRouteEntryImportParameters- Returns:
- peer Role of announcer Peer
-
getFromPeerId
public final PeerId getFromPeerId()
Description copied from interface:BGPRouteEntryImportParametersPeer id of Peer route entry announcer.- Specified by:
getFromPeerIdin interfaceBGPRouteEntryImportParameters- Returns:
- peer Id of announcer Peer
-
getFromClusterId
public final ClusterIdentifier getFromClusterId()
Description copied from interface:BGPRouteEntryImportParametersPeer id of Peer route entry announcer.- Specified by:
getFromClusterIdin interfaceBGPRouteEntryImportParameters- Returns:
- peer Id of announcer Peer
-
onTransactionChainSuccessful
public final void onTransactionChainSuccessful(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain)
- Specified by:
onTransactionChainSuccessfulin interfaceorg.opendaylight.mdsal.dom.api.DOMTransactionChainListener
-
getBGPErrorHandlingState
public final BGPErrorHandlingState getBGPErrorHandlingState()
Description copied from interface:BGPPeerStateError Handling State.- Specified by:
getBGPErrorHandlingStatein interfaceBGPPeerState- Returns:
- ErrorHandlingState
-
getBGPAfiSafiState
public final BGPAfiSafiState getBGPAfiSafiState()
Description copied from interface:BGPPeerStateAfi Safi Operational State.- Specified by:
getBGPAfiSafiStatein interfaceBGPPeerState- Returns:
- AfiSafiState
-
getFromPeerLocalAs
public final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber getFromPeerLocalAs()
Description copied from interface:BGPRouteEntryImportParametersPeer local AS of route entry announcer.- Specified by:
getFromPeerLocalAsin interfaceBGPRouteEntryImportParameters- Returns:
- peer Local AS
-
getName
public final String getName()
Description copied from interface:PeerReturn peer's symbolic name.
-
getClusterId
public final ClusterIdentifier getClusterId()
Description copied from interface:PeerTrackerInformationReturns Cluster Id.- Specified by:
getClusterIdin interfacePeerTrackerInformation- Returns:
- Cluster Id
-
getLocalAs
public final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber getLocalAs()
Description copied from interface:PeerTrackerInformationReturns Local AS.- Specified by:
getLocalAsin interfacePeerTrackerInformation- Returns:
- AS
-
getDomChain
public org.opendaylight.mdsal.dom.api.DOMTransactionChain getDomChain()
Description copied from interface:PeerTransactionChainReturns Peer DOMTransactionChain.- Specified by:
getDomChainin interfacePeerTransactionChain- Returns:
- DOMTransactionChain
-
initializeRibOut
public final <C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>> void initializeRibOut(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C,S>> routesToStore)
Description copied from interface:PeerStores under peers rib Out already present routes, before proceed to process any new route advertizement.- Specified by:
initializeRibOutin interfacePeer- Parameters:
entryDep- RouteEntryDependenciesContainerroutesToStore- routes to be advertized.
-
refreshRibOut
public final <C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>> void refreshRibOut(RouteEntryDependenciesContainer entryDep, List<StaleBestPathRoute> staleRoutes, List<AdvertizedRoute<C,S>> newRoutes)
Description copied from interface:PeerUpdate peers ribout after path selection processing.- Specified by:
refreshRibOutin interfacePeer- Parameters:
entryDep- RouteEntryDependenciesContainerstaleRoutes- routes to be removed.newRoutes- routes to be advertized.
-
reEvaluateAdvertizement
public final <C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>> void reEvaluateAdvertizement(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C,S>> routesToStore)
Description copied from interface:PeerApplies all policies through all present routes, and advertize/withdraws based on new results. Scenario would be for example a removal of RT membership. And reprocess VPN routes.- Specified by:
reEvaluateAdvertizementin interfacePeer- Parameters:
entryDep- RouteEntryDependenciesContainerroutesToStore- routes to be updated.
-
-