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);
}
}
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);
}
}
Aggregations