Class StrictBGPPeerRegistry
- java.lang.Object
- 
- org.opendaylight.protocol.bgp.rib.impl.StrictBGPPeerRegistry
 
- 
- All Implemented Interfaces:
- AutoCloseable,- BGPPeerRegistry
 
 @Singleton @MetaInfServices public final class StrictBGPPeerRegistry extends Object implements BGPPeerRegistry, AutoCloseable BGP peer registry that allows only 1 session per BGP peer. If a second session with peer is established, one of the sessions will be dropped. The session with lower source BGP id will be dropped. This class is thread-safe.
- 
- 
Constructor SummaryConstructors Constructor Description StrictBGPPeerRegistry()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp, BGPSessionListener peer, BGPSessionPreferences preferences)Add configured peer, its IP address and preferences.voidclose()static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZonegetIpAddress(SocketAddress socketAddress)Creates IpAddress from SocketAddress.BGPSessionListenergetPeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone ip, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone sourceId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone remoteId, Open openObj)Get configured peer after BGP session was successfully established.BGPSessionPreferencesgetPeerPreferences(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone ip)Get preferences for a remote peer.booleanisPeerConfigured(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp)Check whether peer on provided IP address is present in this registry.org.opendaylight.yangtools.concepts.RegistrationregisterPeerRegisterListener(PeerRegistryListener listener)Register PeerRegistryListener, which listens to the changes in peer registry (add peer, remove peer).org.opendaylight.yangtools.concepts.RegistrationregisterPeerSessionListener(PeerRegistrySessionListener listener)Register PeerRegistrySessionListener, which listens to the changes in sessions of peers in peer registry (create session, remove session).voidremovePeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp)Remove configured peer from registry.voidremovePeerSession(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp)Remove peer session from registry.StringtoString()voidupdatePeerPreferences(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone address, BGPSessionPreferences preferences)Set new preferences.
 
- 
- 
- 
Method Detail- 
addPeerpublic void addPeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp, BGPSessionListener peer, BGPSessionPreferences preferences)Description copied from interface:BGPPeerRegistryAdd configured peer, its IP address and preferences. To be used when a BGP session is established.- Specified by:
- addPeerin interface- BGPPeerRegistry
- Parameters:
- oldIp- address of remote peer
- peer- configured peer as BGPSessionListener
- preferences- session preferences for configured peer
 
 - 
removePeerpublic void removePeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp) Description copied from interface:BGPPeerRegistryRemove configured peer from registry.- Specified by:
- removePeerin interface- BGPPeerRegistry
- Parameters:
- oldIp- address of remote peer
 
 - 
removePeerSessionpublic void removePeerSession(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp) Description copied from interface:BGPPeerRegistryRemove peer session from registry.- Specified by:
- removePeerSessionin interface- BGPPeerRegistry
- Parameters:
- oldIp- address of remote peer
 
 - 
isPeerConfiguredpublic boolean isPeerConfigured(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone oldIp) Description copied from interface:BGPPeerRegistryCheck whether peer on provided IP address is present in this registry.- Specified by:
- isPeerConfiguredin interface- BGPPeerRegistry
- Parameters:
- oldIp- address of remote peer
- Returns:
- true if peer is present false otherwise
 
 - 
getPeerpublic BGPSessionListener getPeer(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone ip, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone sourceId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone remoteId, Open openObj) throws BGPDocumentedException Description copied from interface:BGPPeerRegistryGet configured peer after BGP session was successfully established. Called by negotiators.- Specified by:
- getPeerin interface- BGPPeerRegistry
- Parameters:
- ip- address of remote peer
- sourceId- BGP ID of peer that initiated the session (current device or remote peer)
- remoteId- BGP ID of peer that accepted the session (current device or remote peer)
- openObj- remote Open message
- Returns:
- BGPSessionListener configured Peer as BGP listener
- Throws:
- BGPDocumentedException- if session establishment cannot be finished successfully
 
 - 
getPeerPreferencespublic BGPSessionPreferences getPeerPreferences(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone ip) Description copied from interface:BGPPeerRegistryGet preferences for a remote peer.- Specified by:
- getPeerPreferencesin interface- BGPPeerRegistry
- Parameters:
- ip- address of remote peer
- Returns:
- BGP session preferences for configured peer
 
 - 
getIpAddresspublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone getIpAddress(SocketAddress socketAddress) Creates IpAddress from SocketAddress. Only InetSocketAddress is accepted with inner address: Inet4Address and Inet6Address.- Parameters:
- socketAddress- socket address to transform
- Returns:
- IpAddress equivalent to given socket address
- Throws:
- IllegalArgumentException- if submitted socket address is not InetSocketAddress[ipv4 | ipv6]
 
 - 
close@PreDestroy public void close() - Specified by:
- closein interface- AutoCloseable
 
 - 
registerPeerRegisterListenerpublic org.opendaylight.yangtools.concepts.Registration registerPeerRegisterListener(PeerRegistryListener listener) Description copied from interface:BGPPeerRegistryRegister PeerRegistryListener, which listens to the changes in peer registry (add peer, remove peer). After registration, an initial drop is provided by calling onPeerAdded().- Specified by:
- registerPeerRegisterListenerin interface- BGPPeerRegistry
- Parameters:
- listener- The PeerRegistryListener to be registered.
- Returns:
- Registration ticked, used for closing of registration.
 
 - 
registerPeerSessionListenerpublic org.opendaylight.yangtools.concepts.Registration registerPeerSessionListener(PeerRegistrySessionListener listener) Description copied from interface:BGPPeerRegistryRegister PeerRegistrySessionListener, which listens to the changes in sessions of peers in peer registry (create session, remove session). After registration, an initial drop is provided by calling onSessionCreated().- Specified by:
- registerPeerSessionListenerin interface- BGPPeerRegistry
- Parameters:
- listener- The PeerRegistrySessionListener to be registered.
- Returns:
- Registration ticked, used for closing of registration.
 
 - 
updatePeerPreferencespublic void updatePeerPreferences(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone address, BGPSessionPreferences preferences)Description copied from interface:BGPPeerRegistrySet new preferences. In case of graceful restart execution we need to send updated GracefulRestartCapability when sesison re-establish, information which tables where preserved during restart will change. Note that this method only updates preferences of already registered peer. To add new peer to registry use addPeer().- Specified by:
- updatePeerPreferencesin interface- BGPPeerRegistry
- Parameters:
- address- of neighbor
- preferences- to send in OPEN message
 
 
- 
 
-