X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=bgp%2Frib-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fbgp%2Frib%2Fimpl%2Fspi%2FPeerExportGroupRegistry.java;fp=bgp%2Frib-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fbgp%2Frib%2Fimpl%2Fspi%2FPeerExportGroupRegistry.java;h=844ec94a762529bd389cb78d2c638bcc615a0a97;hb=aa71d43f58dc8b5242553ecc75a196fb5c0ca5e6;hp=0000000000000000000000000000000000000000;hpb=1900f3edb1aa1a8697f6140e463aa1e9c483f423;p=bgpcep.git diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/PeerExportGroupRegistry.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/PeerExportGroupRegistry.java new file mode 100644 index 0000000000..844ec94a76 --- /dev/null +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/PeerExportGroupRegistry.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.protocol.bgp.rib.impl.spi; + +import com.google.common.annotations.Beta; +import org.opendaylight.protocol.bgp.rib.spi.PeerExportGroup; +import org.opendaylight.protocol.concepts.AbstractRegistration; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId; + +/** + * PeerExportGroup Registry. Register should be maintained in blocking mode to avoid race between + * updating the routes and notify to a peer which doesn't longer exist. BUG-7676 + */ +@Beta +public interface PeerExportGroupRegistry extends PeerExportGroup { + /** + * Register peer to this exportGroup + * + * @param peerId Peer Id + * @param peerExporTuple Peer Export Tuple + * @return registration ticket which take allows to unregister peer + */ + AbstractRegistration registerPeer(PeerId peerId, PeerExporTuple peerExporTuple); + + /** + * @return true if none peer is registered. + */ + boolean isEmpty(); +}