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.BGPGracelfulRestartState
getBGPGracelfulRestart()
BGP Operational GracelfulRestart State.BGPPeerMessagesState
getBGPPeerMessagesState()
BGP Message Operational State.long
getErroneousUpdateReceivedCount()
Erroneous Update Received count.String
getGroupId()
PeerGroup Id.int
getLlGracefulRestartTimer(TablesKey tablesKey)
If table is both advertised and received return timer with lower value.BgpAfiSafiGracefulRestartState.Mode
getMode()
Returns operational mode of graceful restart.org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone
getNeighborAddress()
Return Neighbor Key/Address.long
getNotificationMessagesReceivedCount()
Notification Update Messages Received count.long
getNotificationMessagesSentCount()
Notification Messages Sent count.int
getPeerRestartTime()
The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.BGPPeerState
getPeerState()
Returns Peer Operational State.long
getPrefixesInstalledCount(TablesKey tablesKey)
Prefixes installed per specific tablekey.long
getPrefixesReceivedCount(TablesKey tablesKey)
Prefixed received from the peer count.long
getPrefixesSentCount(TablesKey tablesKey)
Prefixed sent to the Peer count.long
getTotalPrefixes()
Prefixes installed under Effective-Rib-In for a BGP neighbor.long
getUpdateMessagesReceivedCount()
Update Messages Received count.long
getUpdateMessagesSentCount()
Update Messages Sent count.boolean
isActive()
Indicates whether this instance is being actively managed and updated.boolean
isAfiSafiSupported(TablesKey tablesKey)
is AfiSafi Supported.boolean
isGracefulRestartAdvertized(TablesKey tablesKey)
is Graceful Restart Supported advertized to neighbor.boolean
isGracefulRestartReceived(TablesKey tablesKey)
is Graceful Restart Supported advertized by neighbor.boolean
isLlGracefulRestartAdvertised(TablesKey tablesKey)
is Long-lived Graceful Restart Support advertised to neighbor.boolean
isLlGracefulRestartReceived(TablesKey tablesKey)
is Long-lived Graceful Restart Support advertised by neighbor.boolean
isLocalRestarting()
This flag indicates whether the local neighbor is currently restarting.boolean
isPeerRestarting()
This flag indicates whether the remote neighbor is currently in the process of restarting, and hence received routes are currently stale.void
messageReceived(org.opendaylight.yangtools.yang.binding.Notification msg)
Fired when message is received.void
messageSent(org.opendaylight.yangtools.yang.binding.Notification msg)
Fired when message is sent.protected void
registerPrefixesCounters(@NonNull PrefixesReceivedCounters newPrefixesReceived, @NonNull PrefixesInstalledCounters newPrefixesInstalled)
protected void
registerPrefixesSentCounter(TablesKey tablesKey, PrefixesSentCounters prefixesSentCounter)
protected void
resetState()
protected void
setActive(boolean active)
protected void
setAdvertizedGracefulRestartTableTypes(List<TablesKey> receivedGraceful)
void
setAdvertizedLlGracefulRestartTableTypes(Map<TablesKey,Integer> afiSafiReceived)
void
setAfiSafiGracefulRestartState(int newPeerRestartTime, boolean newPeerRestarting, boolean newLocalRestarting)
protected void
setLocalRestartingState(boolean restarting)
protected void
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
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:BGPPeerState
PeerGroup Id.- Specified by:
getGroupId
in 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:BGPPeerState
Return Neighbor Key/Address.- Specified by:
getNeighborAddress
in interfaceBGPPeerState
- Returns:
- neighbor Address
-
getTotalPrefixes
public final long getTotalPrefixes()
Description copied from interface:BGPPeerState
Prefixes installed under Effective-Rib-In for a BGP neighbor.- Specified by:
getTotalPrefixes
in interfaceBGPPeerState
- Returns:
- Paths counter
-
getBGPPeerMessagesState
public final BGPPeerMessagesState getBGPPeerMessagesState()
Description copied from interface:BGPPeerState
BGP Message Operational State.- Specified by:
getBGPPeerMessagesState
in interfaceBGPPeerState
- Returns:
- BGPPeerMessagesState
-
getBGPGracelfulRestart
public final BGPGracelfulRestartState getBGPGracelfulRestart()
Description copied from interface:BGPPeerState
BGP Operational GracelfulRestart State.- Specified by:
getBGPGracelfulRestart
in interfaceBGPPeerState
- Returns:
- BGPGracelfulRestartState
-
isAfiSafiSupported
public final boolean isAfiSafiSupported(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiState
is AfiSafi Supported.- Specified by:
isAfiSafiSupported
in 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:BGPAfiSafiState
Prefixes installed per specific tablekey.- Specified by:
getPrefixesInstalledCount
in interfaceBGPAfiSafiState
- Parameters:
tablesKey
- tables Key- Returns:
- count
-
getPrefixesSentCount
public final long getPrefixesSentCount(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiState
Prefixed sent to the Peer count.- Specified by:
getPrefixesSentCount
in interfaceBGPAfiSafiState
- Parameters:
tablesKey
- tablesKey Type- Returns:
- Prefixes sent count
-
getPrefixesReceivedCount
public final long getPrefixesReceivedCount(TablesKey tablesKey)
Description copied from interface:BGPAfiSafiState
Prefixed received from the peer count.- Specified by:
getPrefixesReceivedCount
in interfaceBGPAfiSafiState
- Parameters:
tablesKey
- tablesKey Type- Returns:
- Prefixed received count
-
getAfiSafisAdvertized
public final Set<TablesKey> getAfiSafisAdvertized()
Description copied from interface:BGPAfiSafiState
List of TablesKey - Afi Safi Advertized to the neighbor.- Specified by:
getAfiSafisAdvertized
in interfaceBGPAfiSafiState
- Returns:
- TableKeys
-
getAfiSafisReceived
public final Set<TablesKey> getAfiSafisReceived()
Description copied from interface:BGPAfiSafiState
List of TablesKey - Afi Safi Advertized by neighbor.- Specified by:
getAfiSafisReceived
in interfaceBGPAfiSafiState
- Returns:
- TableKeys
-
isGracefulRestartAdvertized
public final boolean isGracefulRestartAdvertized(TablesKey tablesKey)
Description copied from interface:BGPGracelfulRestartState
is Graceful Restart Supported advertized to neighbor.- Specified by:
isGracefulRestartAdvertized
in 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:BGPGracelfulRestartState
is Graceful Restart Supported advertized by neighbor.- Specified by:
isGracefulRestartReceived
in interfaceBGPGracelfulRestartState
- Parameters:
tablesKey
- tables Key- Returns:
- true if Afi Safi was advertized by neighbor
-
isLocalRestarting
public final boolean isLocalRestarting()
Description copied from interface:BGPGracelfulRestartState
This flag indicates whether the local neighbor is currently restarting.- Specified by:
isLocalRestarting
in interfaceBGPGracelfulRestartState
- Returns:
- local restarting state
-
getPeerRestartTime
public final int getPeerRestartTime()
Description copied from interface:BGPGracelfulRestartState
The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.- Specified by:
getPeerRestartTime
in interfaceBGPGracelfulRestartState
- Returns:
- time
-
isPeerRestarting
public final boolean isPeerRestarting()
Description copied from interface:BGPGracelfulRestartState
This flag indicates whether the remote neighbor is currently in the process of restarting, and hence received routes are currently stale.- Specified by:
isPeerRestarting
in 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:BGPPeerStateConsumer
Returns Peer Operational State.- Specified by:
getPeerState
in interfaceBGPPeerStateConsumer
- Returns:
- BGP Peer State
-
getErroneousUpdateReceivedCount
public final long getErroneousUpdateReceivedCount()
Description copied from interface:BGPErrorHandlingState
Erroneous Update Received count.- Specified by:
getErroneousUpdateReceivedCount
in interfaceBGPErrorHandlingState
- Returns:
- count
-
getUpdateMessagesSentCount
public final long getUpdateMessagesSentCount()
Description copied from interface:BGPPeerMessagesState
Update Messages Sent count.- Specified by:
getUpdateMessagesSentCount
in interfaceBGPPeerMessagesState
- Returns:
- count
-
getNotificationMessagesSentCount
public final long getNotificationMessagesSentCount()
Description copied from interface:BGPPeerMessagesState
Notification Messages Sent count.- Specified by:
getNotificationMessagesSentCount
in interfaceBGPPeerMessagesState
- Returns:
- count
-
getUpdateMessagesReceivedCount
public final long getUpdateMessagesReceivedCount()
Description copied from interface:BGPPeerMessagesState
Update Messages Received count.- Specified by:
getUpdateMessagesReceivedCount
in interfaceBGPPeerMessagesState
- Returns:
- count
-
getNotificationMessagesReceivedCount
public final long getNotificationMessagesReceivedCount()
Description copied from interface:BGPPeerMessagesState
Notification Update Messages Received count.- Specified by:
getNotificationMessagesReceivedCount
in interfaceBGPPeerMessagesState
- Returns:
- count
-
messageSent
public final void messageSent(org.opendaylight.yangtools.yang.binding.Notification msg)
Description copied from interface:BGPMessagesListener
Fired when message is sent.- Specified by:
messageSent
in interfaceBGPMessagesListener
- Parameters:
msg
- message
-
messageReceived
public final void messageReceived(org.opendaylight.yangtools.yang.binding.Notification msg)
Description copied from interface:BGPMessagesListener
Fired when message is received.- Specified by:
messageReceived
in interfaceBGPMessagesListener
- Parameters:
msg
- message
-
isActive
public final boolean isActive()
Description copied from interface:BGPPeerState
Indicates whether this instance is being actively managed and updated.- Specified by:
isActive
in interfaceBGPPeerState
- Returns:
- active
-
setActive
protected final void setActive(boolean active)
-
getMode
public final BgpAfiSafiGracefulRestartState.Mode getMode()
Description copied from interface:BGPGracelfulRestartState
Returns operational mode of graceful restart. Result depends on advertising and receiving graceful restart capability to/from peer.- Specified by:
getMode
in 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:BGPLlGracelfulRestartState
is Long-lived Graceful Restart Support advertised to neighbor.- Specified by:
isLlGracefulRestartAdvertised
in 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:BGPLlGracelfulRestartState
is Long-lived Graceful Restart Support advertised by neighbor.- Specified by:
isLlGracefulRestartReceived
in 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:BGPLlGracelfulRestartState
If table is both advertised and received return timer with lower value. If table is not advertised or received return zero.- Specified by:
getLlGracefulRestartTimer
in interfaceBGPLlGracelfulRestartState
- Parameters:
tablesKey
- tables key- Returns:
- effective value of timer in seconds
-
-