Class BGPPeerStateImpl
- java.lang.Object
-
- org.opendaylight.protocol.bgp.rib.DefaultRibReference
-
- org.opendaylight.protocol.bgp.rib.impl.state.BGPPeerStateImpl
-
- All Implemented Interfaces:
BGPMessagesListener,RibReference,BGPAfiSafiState,BGPErrorHandlingState,BGPGracelfulRestartState,BGPLlGracelfulRestartState,BGPPeerMessagesState,BGPPeerState,BGPPeerStateConsumer,InstanceReference<Rib>
- Direct Known Subclasses:
ApplicationPeer,BGPPeer
public abstract class BGPPeerStateImpl extends DefaultRibReference implements BGPPeerState, BGPAfiSafiState, BGPGracelfulRestartState, BGPLlGracelfulRestartState, BGPErrorHandlingState, BGPPeerMessagesState, BGPPeerStateConsumer, BGPMessagesListener
-
-
Constructor Summary
Constructors Constructor Description BGPPeerStateImpl(@NonNull org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier<Rib,RibKey> instanceIdentifier, @Nullable String groupId, @NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone neighborAddress, @NonNull Set<TablesKey> afiSafisAdvertized, @NonNull Set<TablesKey> afiSafisGracefulAdvertized, @NonNull Map<TablesKey,Integer> afiSafisLlGracefulAdvertized)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<TablesKey>getAfiSafisAdvertized()List of TablesKey - Afi Safi Advertized to the neighbor.Set<TablesKey>getAfiSafisReceived()List of TablesKey - Afi Safi Advertized by neighbor.BGPGracelfulRestartStategetBGPGracelfulRestart()BGP Operational GracelfulRestart State.BGPPeerMessagesStategetBGPPeerMessagesState()BGP Message Operational State.longgetErroneousUpdateReceivedCount()Erroneous Update Received count.StringgetGroupId()PeerGroup Id.intgetLlGracefulRestartTimer(TablesKey tablesKey)If table is both advertised and received return timer with lower value.BgpAfiSafiGracefulRestartState.ModegetMode()Returns operational mode of graceful restart.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZonegetNeighborAddress()Return Neighbor Key/Address.longgetNotificationMessagesReceivedCount()Notification Update Messages Received count.longgetNotificationMessagesSentCount()Notification Messages Sent count.intgetPeerRestartTime()The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.BGPPeerStategetPeerState()Returns Peer Operational State.longgetPrefixesInstalledCount(TablesKey tablesKey)Prefixes installed per specific tablekey.longgetPrefixesReceivedCount(TablesKey tablesKey)Prefixed received from the peer count.longgetPrefixesSentCount(TablesKey tablesKey)Prefixed sent to the Peer count.longgetTotalPrefixes()Prefixes installed under Effective-Rib-In for a BGP neighbor.longgetUpdateMessagesReceivedCount()Update Messages Received count.longgetUpdateMessagesSentCount()Update Messages Sent count.booleanisActive()Indicates whether this instance is being actively managed and updated.booleanisAfiSafiSupported(TablesKey tablesKey)is AfiSafi Supported.booleanisGracefulRestartAdvertized(TablesKey tablesKey)is Graceful Restart Supported advertized to neighbor.booleanisGracefulRestartReceived(TablesKey tablesKey)is Graceful Restart Supported advertized by neighbor.booleanisLlGracefulRestartAdvertised(TablesKey tablesKey)is Long-lived Graceful Restart Support advertised to neighbor.booleanisLlGracefulRestartReceived(TablesKey tablesKey)is Long-lived Graceful Restart Support advertised by neighbor.booleanisLocalRestarting()This flag indicates whether the local neighbor is currently restarting.booleanisPeerRestarting()This flag indicates whether the remote neighbor is currently in the process of restarting, and hence received routes are currently stale.voidmessageReceived(org.opendaylight.yangtools.yang.binding.Notification msg)Fired when message is received.voidmessageSent(org.opendaylight.yangtools.yang.binding.Notification msg)Fired when message is sent.protected voidregisterPrefixesCounters(@NonNull PrefixesReceivedCounters newPrefixesReceived, @NonNull PrefixesInstalledCounters newPrefixesInstalled)protected voidregisterPrefixesSentCounter(TablesKey tablesKey, PrefixesSentCounters prefixesSentCounter)protected voidresetState()protected voidsetActive(boolean active)protected voidsetAdvertizedGracefulRestartTableTypes(List<TablesKey> receivedGraceful)voidsetAdvertizedLlGracefulRestartTableTypes(Map<TablesKey,Integer> afiSafiReceived)voidsetAfiSafiGracefulRestartState(int newPeerRestartTime, boolean newPeerRestarting, boolean newLocalRestarting)protected voidsetLocalRestartingState(boolean restarting)protected voidsetRestartingState()-
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
getBGPAfiSafiState, getBGPErrorHandlingState, getBGPSessionState, getBGPTimersState, getBGPTransportState, getTotalPathsCount
-
Methods inherited from interface org.opendaylight.protocol.bgp.rib.RibReference
getInstanceIdentifier
-
-
-
-
Constructor Detail
-
BGPPeerStateImpl
public BGPPeerStateImpl(@NonNull org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier<Rib,RibKey> instanceIdentifier, @Nullable String groupId, @NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone neighborAddress, @NonNull Set<TablesKey> afiSafisAdvertized, @NonNull Set<TablesKey> afiSafisGracefulAdvertized, @NonNull Map<TablesKey,Integer> afiSafisLlGracefulAdvertized)
-
-
Method Detail
-
getGroupId
public final String getGroupId()
Description copied from interface:BGPPeerStatePeerGroup Id.- Specified by:
getGroupIdin interfaceBGPPeerState- Returns:
- PeerGroup Id
-
getNeighborAddress
public final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone getNeighborAddress()
Description copied from interface:BGPPeerStateReturn Neighbor Key/Address.- Specified by:
getNeighborAddressin interfaceBGPPeerState- Returns:
- neighbor Address
-
getTotalPrefixes
public final long getTotalPrefixes()
Description copied from interface:BGPPeerStatePrefixes installed under Effective-Rib-In for a BGP neighbor.- Specified by:
getTotalPrefixesin interfaceBGPPeerState- Returns:
- Paths counter
-
getBGPPeerMessagesState
public final BGPPeerMessagesState getBGPPeerMessagesState()
Description copied from interface:BGPPeerStateBGP Message Operational State.- Specified by:
getBGPPeerMessagesStatein interfaceBGPPeerState- Returns:
- BGPPeerMessagesState
-
getBGPGracelfulRestart
public final BGPGracelfulRestartState getBGPGracelfulRestart()
Description copied from interface:BGPPeerStateBGP Operational GracelfulRestart State.- Specified by:
getBGPGracelfulRestartin interfaceBGPPeerState- Returns:
- BGPGracelfulRestartState
-
isAfiSafiSupported
public final boolean isAfiSafiSupported(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiStateis AfiSafi Supported.- Specified by:
isAfiSafiSupportedin interfaceBGPAfiSafiState- Parameters:
tablesKey- tables Key- Returns:
- true if Afi Safi was advertized to and by the neighbor
-
getPrefixesInstalledCount
public final long getPrefixesInstalledCount(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiStatePrefixes installed per specific tablekey.- Specified by:
getPrefixesInstalledCountin interfaceBGPAfiSafiState- Parameters:
tablesKey- tables Key- Returns:
- count
-
getPrefixesSentCount
public final long getPrefixesSentCount(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiStatePrefixed sent to the Peer count.- Specified by:
getPrefixesSentCountin interfaceBGPAfiSafiState- Parameters:
tablesKey- tablesKey Type- Returns:
- Prefixes sent count
-
getPrefixesReceivedCount
public final long getPrefixesReceivedCount(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiStatePrefixed received from the peer count.- Specified by:
getPrefixesReceivedCountin interfaceBGPAfiSafiState- Parameters:
tablesKey- tablesKey Type- Returns:
- Prefixed received count
-
getAfiSafisAdvertized
public final Set<TablesKey> getAfiSafisAdvertized()
Description copied from interface:BGPAfiSafiStateList of TablesKey - Afi Safi Advertized to the neighbor.- Specified by:
getAfiSafisAdvertizedin interfaceBGPAfiSafiState- Returns:
- TableKeys
-
getAfiSafisReceived
public final Set<TablesKey> getAfiSafisReceived()
Description copied from interface:BGPAfiSafiStateList of TablesKey - Afi Safi Advertized by neighbor.- Specified by:
getAfiSafisReceivedin interfaceBGPAfiSafiState- Returns:
- TableKeys
-
isGracefulRestartAdvertized
public final boolean isGracefulRestartAdvertized(TablesKey tablesKey)
Description copied from interface:BGPGracelfulRestartStateis Graceful Restart Supported advertized to neighbor.- Specified by:
isGracefulRestartAdvertizedin interfaceBGPGracelfulRestartState- Parameters:
tablesKey- tables Key- Returns:
- true if Afi Safi was advertized to neighbor
-
isGracefulRestartReceived
public final boolean isGracefulRestartReceived(TablesKey tablesKey)
Description copied from interface:BGPGracelfulRestartStateis Graceful Restart Supported advertized by neighbor.- Specified by:
isGracefulRestartReceivedin interfaceBGPGracelfulRestartState- Parameters:
tablesKey- tables Key- Returns:
- true if Afi Safi was advertized by neighbor
-
isLocalRestarting
public final boolean isLocalRestarting()
Description copied from interface:BGPGracelfulRestartStateThis flag indicates whether the local neighbor is currently restarting.- Specified by:
isLocalRestartingin interfaceBGPGracelfulRestartState- Returns:
- local restarting state
-
getPeerRestartTime
public final int getPeerRestartTime()
Description copied from interface:BGPGracelfulRestartStateThe period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.- Specified by:
getPeerRestartTimein interfaceBGPGracelfulRestartState- Returns:
- time
-
isPeerRestarting
public final boolean isPeerRestarting()
Description copied from interface:BGPGracelfulRestartStateThis flag indicates whether the remote neighbor is currently in the process of restarting, and hence received routes are currently stale.- Specified by:
isPeerRestartingin interfaceBGPGracelfulRestartState- Returns:
- peer is restarting
-
setAfiSafiGracefulRestartState
public final void setAfiSafiGracefulRestartState(int newPeerRestartTime, boolean newPeerRestarting, boolean newLocalRestarting)
-
setAdvertizedGracefulRestartTableTypes
protected final void setAdvertizedGracefulRestartTableTypes(List<TablesKey> receivedGraceful)
-
registerPrefixesSentCounter
protected final void registerPrefixesSentCounter(TablesKey tablesKey, PrefixesSentCounters prefixesSentCounter)
-
registerPrefixesCounters
protected final void registerPrefixesCounters(@NonNull PrefixesReceivedCounters newPrefixesReceived, @NonNull PrefixesInstalledCounters newPrefixesInstalled)
-
resetState
protected final void resetState()
-
setRestartingState
protected final void setRestartingState()
-
setLocalRestartingState
protected final void setLocalRestartingState(boolean restarting)
-
getPeerState
public final BGPPeerState getPeerState()
Description copied from interface:BGPPeerStateConsumerReturns Peer Operational State.- Specified by:
getPeerStatein interfaceBGPPeerStateConsumer- Returns:
- BGP Peer State
-
getErroneousUpdateReceivedCount
public final long getErroneousUpdateReceivedCount()
Description copied from interface:BGPErrorHandlingStateErroneous Update Received count.- Specified by:
getErroneousUpdateReceivedCountin interfaceBGPErrorHandlingState- Returns:
- count
-
getUpdateMessagesSentCount
public final long getUpdateMessagesSentCount()
Description copied from interface:BGPPeerMessagesStateUpdate Messages Sent count.- Specified by:
getUpdateMessagesSentCountin interfaceBGPPeerMessagesState- Returns:
- count
-
getNotificationMessagesSentCount
public final long getNotificationMessagesSentCount()
Description copied from interface:BGPPeerMessagesStateNotification Messages Sent count.- Specified by:
getNotificationMessagesSentCountin interfaceBGPPeerMessagesState- Returns:
- count
-
getUpdateMessagesReceivedCount
public final long getUpdateMessagesReceivedCount()
Description copied from interface:BGPPeerMessagesStateUpdate Messages Received count.- Specified by:
getUpdateMessagesReceivedCountin interfaceBGPPeerMessagesState- Returns:
- count
-
getNotificationMessagesReceivedCount
public final long getNotificationMessagesReceivedCount()
Description copied from interface:BGPPeerMessagesStateNotification Update Messages Received count.- Specified by:
getNotificationMessagesReceivedCountin interfaceBGPPeerMessagesState- Returns:
- count
-
messageSent
public final void messageSent(org.opendaylight.yangtools.yang.binding.Notification msg)
Description copied from interface:BGPMessagesListenerFired when message is sent.- Specified by:
messageSentin interfaceBGPMessagesListener- Parameters:
msg- message
-
messageReceived
public final void messageReceived(org.opendaylight.yangtools.yang.binding.Notification msg)
Description copied from interface:BGPMessagesListenerFired when message is received.- Specified by:
messageReceivedin interfaceBGPMessagesListener- Parameters:
msg- message
-
isActive
public final boolean isActive()
Description copied from interface:BGPPeerStateIndicates whether this instance is being actively managed and updated.- Specified by:
isActivein interfaceBGPPeerState- Returns:
- active
-
setActive
protected final void setActive(boolean active)
-
getMode
public final BgpAfiSafiGracefulRestartState.Mode getMode()
Description copied from interface:BGPGracelfulRestartStateReturns operational mode of graceful restart. Result depends on advertising and receiving graceful restart capability to/from peer.- Specified by:
getModein interfaceBGPGracelfulRestartState- Returns:
- graceful restart operational mode
-
setAdvertizedLlGracefulRestartTableTypes
public final void setAdvertizedLlGracefulRestartTableTypes(Map<TablesKey,Integer> afiSafiReceived)
-
isLlGracefulRestartAdvertised
public final boolean isLlGracefulRestartAdvertised(TablesKey tablesKey)
Description copied from interface:BGPLlGracelfulRestartStateis Long-lived Graceful Restart Support advertised to neighbor.- Specified by:
isLlGracefulRestartAdvertisedin interfaceBGPLlGracelfulRestartState- Parameters:
tablesKey- tables Key- Returns:
- true if Afi Safi was advertised to neighbor
-
isLlGracefulRestartReceived
public final boolean isLlGracefulRestartReceived(TablesKey tablesKey)
Description copied from interface:BGPLlGracelfulRestartStateis Long-lived Graceful Restart Support advertised by neighbor.- Specified by:
isLlGracefulRestartReceivedin interfaceBGPLlGracelfulRestartState- Parameters:
tablesKey- tables Key- Returns:
- true if Afi Safi was advertised by neighbor
-
getLlGracefulRestartTimer
public final int getLlGracefulRestartTimer(TablesKey tablesKey)
Description copied from interface:BGPLlGracelfulRestartStateIf table is both advertised and received return timer with lower value. If table is not advertised or received return zero.- Specified by:
getLlGracefulRestartTimerin interfaceBGPLlGracelfulRestartState- Parameters:
tablesKey- tables key- Returns:
- effective value of timer in seconds
-
-