Class ApplicationPeer
- java.lang.Object
-
- org.opendaylight.protocol.bgp.rib.DefaultRibReference
-
- org.opendaylight.protocol.bgp.rib.impl.state.BGPPeerStateImpl
-
- org.opendaylight.protocol.bgp.rib.impl.ApplicationPeer
-
- All Implemented Interfaces:
EventListener
,org.opendaylight.mdsal.dom.api.ClusteredDOMDataTreeChangeListener
,org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener
,org.opendaylight.mdsal.dom.api.DOMTransactionChainListener
,BGPMessagesListener
,PeerTransactionChain
,RibReference
,Peer
,PeerTrackerInformation
,BGPRouteEntryImportParameters
,RouteTargetMembershipConsumer
,BGPAfiSafiState
,BGPErrorHandlingState
,BGPGracelfulRestartState
,BGPLlGracelfulRestartState
,BGPPeerMessagesState
,BGPPeerState
,BGPPeerStateProvider
,InstanceReference<Rib>
public class ApplicationPeer extends BGPPeerStateImpl implements org.opendaylight.mdsal.dom.api.ClusteredDOMDataTreeChangeListener
Application Peer is a special case of BGP peer. It serves as an interface for user to advertise user routes to ODL and through ODL to other BGP peers.This peer has it's own RIB, where it stores all user routes. This RIB is located in configurational datastore. Routes are added through RESTCONF.
They are then processed as routes from any other peer, through AdjRib, EffectiveRib,LocRib and if they are advertised further, through AdjRibOut.
For purposed of import policies such as Best Path Selection, application peer needs to have a BGP-ID that is configurable.
-
-
Constructor Summary
Constructors Constructor Description ApplicationPeer(BGPTableTypeRegistryConsumer tableTypeRegistry, ApplicationRibId applicationRibId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone ipAddress, RIB rib)
-
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.BGPAfiSafiState
getBGPAfiSafiState()
Afi Safi Operational State.BGPErrorHandlingState
getBGPErrorHandlingState()
Error Handling State.BGPSessionState
getBGPSessionState()
BGP Session Operational State.BGPTimersState
getBGPTimersState()
BGP Operation Timers State.BGPTransportState
getBGPTransportState()
BGP Operational Transport State.ClusterIdentifier
getClusterId()
Returns Cluster Id.org.opendaylight.mdsal.dom.api.DOMTransactionChain
getDomChain()
Returns Peer DOMTransactionChain.ClusterIdentifier
getFromClusterId()
Peer id of Peer route entry announcer.PeerId
getFromPeerId()
Peer id of Peer route entry announcer.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber
getFromPeerLocalAs()
Peer local AS of route entry announcer.PeerRole
getFromPeerRole()
Peer id of Peer route entry announcer.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber
getLocalAs()
Returns Local AS.List<RouteTarget>
getMemberships()
Returns list of Route target advertized per Peer.String
getName()
Return peer's symbolic name.PeerId
getPeerId()
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.PeerRole
getRole()
Returns Peer Role.SendReceive
getSupportedAddPathTables(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.void
instantiateServiceInstance(org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService dataTreeChangeService, org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier appPeerDOMId)
void
onDataTreeChanged(List<org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate> changes)
Routes come from application RIB that is identified by (configurable) name.void
onInitialData()
void
onTransactionChainFailed(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain, org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction transaction, Throwable cause)
void
onTransactionChainSuccessful(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.boolean
supportsAddPathSupported(TablesKey tableKey)
Returns if peer supports Additional Path for specific table.boolean
supportsTable(TablesKey tableKey)
Returns true if we have advertized support for a table, i.e.-
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, toString, 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.RibReference
getInstanceIdentifier
-
-
-
-
Constructor Detail
-
ApplicationPeer
public ApplicationPeer(BGPTableTypeRegistryConsumer tableTypeRegistry, ApplicationRibId applicationRibId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone ipAddress, RIB rib)
-
-
Method Detail
-
getMemberships
public List<RouteTarget> getMemberships()
Description copied from interface:RouteTargetMembershipConsumer
Returns list of Route target advertized per Peer.- Specified by:
getMemberships
in interfaceRouteTargetMembershipConsumer
-
instantiateServiceInstance
public void instantiateServiceInstance(org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService dataTreeChangeService, org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier appPeerDOMId)
-
onInitialData
public void onInitialData()
- Specified by:
onInitialData
in interfaceorg.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener
-
onDataTreeChanged
public void onDataTreeChanged(List<org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate> changes)
Routes come from application RIB that is identified by (configurable) name. Each route is pushed into AdjRibsInWriter with it's whole context. In this method, it doesn't matter if the routes are removed or added, this will be determined in LocRib.- Specified by:
onDataTreeChanged
in interfaceorg.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener
-
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.
-
supportsAddPathSupported
public boolean supportsAddPathSupported(TablesKey tableKey)
Description copied from interface:PeerTrackerInformation
Returns if peer supports Additional Path for specific table.- Specified by:
supportsAddPathSupported
in interfacePeerTrackerInformation
- Parameters:
tableKey
- table- Returns:
- true if Additional Path is supported for defined table
-
getSupportedAddPathTables
public SendReceive getSupportedAddPathTables(TablesKey tableKey)
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
public boolean supportsTable(TablesKey tableKey)
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.
-
onTransactionChainFailed
public void onTransactionChainFailed(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain, org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction transaction, Throwable cause)
- Specified by:
onTransactionChainFailed
in interfaceorg.opendaylight.mdsal.dom.api.DOMTransactionChainListener
-
getBGPSessionState
public BGPSessionState getBGPSessionState()
Description copied from interface:BGPPeerState
BGP Session Operational State.- Specified by:
getBGPSessionState
in interfaceBGPPeerState
- Returns:
- BGPSessionState
-
getBGPTimersState
public BGPTimersState getBGPTimersState()
Description copied from interface:BGPPeerState
BGP Operation Timers State.- Specified by:
getBGPTimersState
in interfaceBGPPeerState
- Returns:
- BGPTimersState
-
getBGPTransportState
public BGPTransportState getBGPTransportState()
Description copied from interface:BGPPeerState
BGP Operational Transport State.- Specified by:
getBGPTransportState
in interfaceBGPPeerState
- Returns:
- BGPTransportState
-
getPeerId
public final PeerId getPeerId()
Description copied from interface:PeerTrackerInformation
Returns Peer id.- Specified by:
getPeerId
in interfacePeerTrackerInformation
- Returns:
- PeerID
-
getRole
public final PeerRole getRole()
Description copied from interface:PeerTrackerInformation
Returns Peer Role.- Specified by:
getRole
in interfacePeerTrackerInformation
- Returns:
- PeerRole
-
getFromPeerRole
public final 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
public final PeerId 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
public final ClusterIdentifier getFromClusterId()
Description copied from interface:BGPRouteEntryImportParameters
Peer id of Peer route entry announcer.- Specified by:
getFromClusterId
in interfaceBGPRouteEntryImportParameters
- Returns:
- peer Id of announcer Peer
-
onTransactionChainSuccessful
public final void onTransactionChainSuccessful(org.opendaylight.mdsal.dom.api.DOMTransactionChain chain)
- Specified by:
onTransactionChainSuccessful
in interfaceorg.opendaylight.mdsal.dom.api.DOMTransactionChainListener
-
getBGPErrorHandlingState
public final BGPErrorHandlingState getBGPErrorHandlingState()
Description copied from interface:BGPPeerState
Error Handling State.- Specified by:
getBGPErrorHandlingState
in interfaceBGPPeerState
- Returns:
- ErrorHandlingState
-
getBGPAfiSafiState
public final BGPAfiSafiState 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
public final String getName()
Description copied from interface:Peer
Return peer's symbolic name.
-
getClusterId
public final ClusterIdentifier 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.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: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.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: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.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: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.
-
-