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:
com.google.common.util.concurrent.FutureCallback<org.opendaylight.yangtools.yang.common.Empty>
,BGPMessagesListener
,PeerTransactionChain
,RibReference
,BGPSessionListener
,Peer
,PeerRPCs
,PeerTrackerInformation
,BGPRouteEntryImportParameters
,RouteTargetMembershipConsumer
,BGPAfiSafiState
,BGPErrorHandlingState
,BGPGracelfulRestartState
,BGPLlGracelfulRestartState
,BGPPeerMessagesState
,BGPPeerState
,BGPPeerStateProvider
,InstanceReference<Rib>
Class representing a peer. We have a single instance for each peer, which provides translation from BGP events into
RIB actions.
-
Constructor Summary
ConstructorDescriptionBGPPeer
(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
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.FluentFuture
<? extends org.opendaylight.mdsal.common.api.CommitInfo> close()
Close Peers and performs asynchronously DS clean up.final BGPAfiSafiState
Afi Safi Operational State.final BGPErrorHandlingState
Error Handling State.BGP Session Operational State.BGP Operation Timers State.BGP Operational Transport State.final ClusterIdentifier
Returns Cluster Id.org.opendaylight.mdsal.dom.api.DOMTransactionChain
Returns Peer DOMTransactionChain.final ClusterIdentifier
Peer id of Peer route entry announcer.final PeerId
Peer id of Peer route entry announcer.final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber
Peer local AS of route entry announcer.final PeerRole
Peer id of Peer route entry announcer.final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber
Returns Local AS.Returns list of Route target advertized per Peer.final String
getName()
Return peer's symbolic name.final PeerId
Returns Peer id.org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
getRibOutIId
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablekey) Creates Table Adj Rib Out Instance identifier.final PeerRole
getRole()
Returns Peer Role.getSupportedAddPathTables
(TablesKey tableKey) Returns AddPath support configuration if supported, otherwise null.final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,
S extends org.opendaylight.yangtools.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.void
void
markUptodate
(TablesKey tablesKey) Marks synchronization finished for given Table key.void
void
onMessage
(BGPSession session, org.opendaylight.yangtools.binding.Notification<?> msg) Fired when a normal protocol message is received.void
onSessionDown
(BGPSession session, Exception exc) Fired when the session went down because of an IO error.void
onSessionTerminated
(BGPSession session, BGPTerminationReason cause) Fired when the session is terminated locally.void
onSessionUp
(BGPSession session) Fired when the session was established successfully.final void
onSuccess
(org.opendaylight.yangtools.yang.common.Empty value) final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,
S extends org.opendaylight.yangtools.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.final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,
S extends org.opendaylight.yangtools.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> Release Peer session.com.google.common.util.concurrent.ListenableFuture
<?> restartGracefully
(long selectionDeferralTimerSeconds) Perform graceful restart.boolean
supportsTable
(TablesKey tableKey) Returns true if we have advertized support for a table, i.e.toString()
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 Details
-
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 Details
-
instantiateServiceInstance
public void instantiateServiceInstance() -
close
public com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo> close()Description copied from interface:Peer
Close Peers and performs asynchronously DS clean up. -
onMessage
public void onMessage(BGPSession session, org.opendaylight.yangtools.binding.Notification<?> msg) throws BGPDocumentedException Description copied from interface:BGPSessionListener
Fired when a normal protocol message is received.- Specified by:
onMessage
in interfaceBGPSessionListener
- Parameters:
msg
- Protocol message- Throws:
BGPDocumentedException
-
onSessionUp
Description copied from interface:BGPSessionListener
Fired when the session was established successfully.- Specified by:
onSessionUp
in interfaceBGPSessionListener
- Parameters:
session
- Peer address families which we accepted
-
onSessionDown
Description copied from interface:BGPSessionListener
Fired when the session went down because of an IO error. Implementation should take care of closing underlying session.- Specified by:
onSessionDown
in interfaceBGPSessionListener
- Parameters:
session
- that went downexc
- Exception that was thrown as the cause of session being down
-
onSessionTerminated
Description copied from interface:BGPSessionListener
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 interfaceBGPSessionListener
- Parameters:
cause
- the cause why the session went down
-
toString
-
releaseConnection
public com.google.common.util.concurrent.FluentFuture<? extends org.opendaylight.mdsal.common.api.CommitInfo> releaseConnection()Description copied from interface:PeerRPCs
Release Peer session.- Specified by:
releaseConnection
in interfacePeerRPCs
-
getSupportedAddPathTables
Description copied from interface:PeerTrackerInformation
Returns AddPath support configuration if supported, otherwise null.- Specified by:
getSupportedAddPathTables
in interfacePeerTrackerInformation
- Parameters:
tableKey
- table- Returns:
- AddPath support configuration if supported, otherwise null
-
supportsTable
Description copied from interface:PeerTrackerInformation
Returns 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:
supportsTable
in 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:PeerTrackerInformation
Creates Table Adj Rib Out Instance identifier.- Specified by:
getRibOutIId
in interfacePeerTrackerInformation
- Parameters:
tablekey
- table key- Returns:
- instance identifier.
-
onFailure
- Specified by:
onFailure
in interfacecom.google.common.util.concurrent.FutureCallback<org.opendaylight.yangtools.yang.common.Empty>
-
markUptodate
Description copied from interface:BGPSessionListener
Marks synchronization finished for given Table key.- Specified by:
markUptodate
in interfaceBGPSessionListener
- Parameters:
tablesKey
- of the table where synchronization finished
-
getBGPSessionState
Description copied from interface:BGPPeerState
BGP Session Operational State.- Specified by:
getBGPSessionState
in interfaceBGPPeerState
- Returns:
- BGPSessionState
-
getBGPTimersState
Description copied from interface:BGPPeerState
BGP Operation Timers State.- Specified by:
getBGPTimersState
in interfaceBGPPeerState
- Returns:
- BGPTimersState
-
getBGPTransportState
Description copied from interface:BGPPeerState
BGP Operational Transport State.- Specified by:
getBGPTransportState
in interfaceBGPPeerState
- Returns:
- BGPTransportState
-
getMemberships
Description copied from interface:RouteTargetMembershipConsumer
Returns list of Route target advertized per Peer.- Specified by:
getMemberships
in interfaceRouteTargetMembershipConsumer
-
restartGracefully
public com.google.common.util.concurrent.ListenableFuture<?> restartGracefully(long selectionDeferralTimerSeconds) Description copied from interface:PeerRPCs
Perform graceful restart. Wait with route selection until EOR is received or selection-deferral-timer expires.- Specified by:
restartGracefully
in interfacePeerRPCs
- Parameters:
selectionDeferralTimerSeconds
- time to wait in seconds
-
getPeerId
Description copied from interface:PeerTrackerInformation
Returns Peer id.- Specified by:
getPeerId
in interfacePeerTrackerInformation
- Returns:
- PeerID
-
getRole
Description copied from interface:PeerTrackerInformation
Returns Peer Role.- Specified by:
getRole
in interfacePeerTrackerInformation
- Returns:
- PeerRole
-
getFromPeerRole
Description copied from interface:BGPRouteEntryImportParameters
Peer id of Peer route entry announcer.- Specified by:
getFromPeerRole
in interfaceBGPRouteEntryImportParameters
- Returns:
- peer Role of announcer Peer
-
getFromPeerId
Description copied from interface:BGPRouteEntryImportParameters
Peer id of Peer route entry announcer.- Specified by:
getFromPeerId
in interfaceBGPRouteEntryImportParameters
- Returns:
- peer Id of announcer Peer
-
getFromClusterId
Description copied from interface:BGPRouteEntryImportParameters
Peer id of Peer route entry announcer.- Specified by:
getFromClusterId
in interfaceBGPRouteEntryImportParameters
- Returns:
- peer Id of announcer Peer
-
onSuccess
public final void onSuccess(org.opendaylight.yangtools.yang.common.Empty value) - Specified by:
onSuccess
in interfacecom.google.common.util.concurrent.FutureCallback<org.opendaylight.yangtools.yang.common.Empty>
-
getBGPErrorHandlingState
Description copied from interface:BGPPeerState
Error Handling State.- Specified by:
getBGPErrorHandlingState
in interfaceBGPPeerState
- Returns:
- ErrorHandlingState
-
getBGPAfiSafiState
Description copied from interface:BGPPeerState
Afi Safi Operational State.- Specified by:
getBGPAfiSafiState
in 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:BGPRouteEntryImportParameters
Peer local AS of route entry announcer.- Specified by:
getFromPeerLocalAs
in interfaceBGPRouteEntryImportParameters
- Returns:
- peer Local AS
-
getName
Description copied from interface:Peer
Return peer's symbolic name. -
getClusterId
Description copied from interface:PeerTrackerInformation
Returns Cluster Id.- Specified by:
getClusterId
in 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:PeerTrackerInformation
Returns Local AS.- Specified by:
getLocalAs
in interfacePeerTrackerInformation
- Returns:
- AS
-
getDomChain
public org.opendaylight.mdsal.dom.api.DOMTransactionChain getDomChain()Description copied from interface:PeerTransactionChain
Returns Peer DOMTransactionChain.- Specified by:
getDomChain
in interfacePeerTransactionChain
- Returns:
- DOMTransactionChain
-
initializeRibOut
public final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.binding.ChildOf<? super C>> void initializeRibOut(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C, S>> routesToStore) Description copied from interface:Peer
Stores under peers rib Out already present routes, before proceed to process any new route advertizement.- Specified by:
initializeRibOut
in interfacePeer
- Parameters:
entryDep
- RouteEntryDependenciesContainerroutesToStore
- routes to be advertized.
-
refreshRibOut
public final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.binding.ChildOf<? super C>> void refreshRibOut(RouteEntryDependenciesContainer entryDep, List<StaleBestPathRoute> staleRoutes, List<AdvertizedRoute<C, S>> newRoutes) Description copied from interface:Peer
Update peers ribout after path selection processing.- Specified by:
refreshRibOut
in interfacePeer
- Parameters:
entryDep
- RouteEntryDependenciesContainerstaleRoutes
- routes to be removed.newRoutes
- routes to be advertized.
-
reEvaluateAdvertizement
public final <C extends Routes & org.opendaylight.yangtools.binding.DataObject & org.opendaylight.yangtools.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.binding.ChildOf<? super C>> void reEvaluateAdvertizement(RouteEntryDependenciesContainer entryDep, List<ActualBestPathRoutes<C, S>> routesToStore) Description copied from interface:Peer
Applies 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:
reEvaluateAdvertizement
in interfacePeer
- Parameters:
entryDep
- RouteEntryDependenciesContainerroutesToStore
- routes to be updated.
-