Search in sources :

Example 1 with PeerRegistryListener

use of org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener in project bgpcep by opendaylight.

the class StrictBGPPeerRegistry method removePeer.

@Override
public synchronized void removePeer(final IpAddress oldIp) {
    IpAddress fullIp = getFullIp(oldIp);
    this.peers.remove(fullIp);
    for (final PeerRegistryListener peerRegistryListener : this.listeners) {
        peerRegistryListener.onPeerRemoved(fullIp);
    }
}
Also used : PeerRegistryListener(org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Example 2 with PeerRegistryListener

use of org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener in project bgpcep by opendaylight.

the class StrictBGPPeerRegistry method addPeer.

@Override
public synchronized void addPeer(final IpAddress oldIp, final BGPSessionListener peer, final BGPSessionPreferences preferences) {
    IpAddress fullIp = getFullIp(oldIp);
    Preconditions.checkArgument(!this.peers.containsKey(fullIp), "Peer for %s already present", fullIp);
    this.peers.put(fullIp, requireNonNull(peer));
    requireNonNull(preferences.getMyAs());
    requireNonNull(preferences.getParams());
    requireNonNull(preferences.getBgpId());
    this.peerPreferences.put(fullIp, preferences);
    for (final PeerRegistryListener peerRegistryListener : this.listeners) {
        peerRegistryListener.onPeerAdded(fullIp, preferences);
    }
}
Also used : PeerRegistryListener(org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

PeerRegistryListener (org.opendaylight.protocol.bgp.rib.impl.spi.PeerRegistryListener)2 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2