import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private Neighbor currentConfiguration;
@GuardedBy("this")
private BgpAppPeerSingletonService bgpAppPeerSingletonService;
- @GuardedBy("this")
- private ServiceRegistration<?> serviceRegistration;
private static ApplicationRibId createAppRibId(final Neighbor neighbor) {
final Config config = neighbor.getConfig();
if (this.bgpAppPeerSingletonService != null) {
this.bgpAppPeerSingletonService = null;
}
- if (this.serviceRegistration != null) {
- this.serviceRegistration.unregister();
- this.serviceRegistration = null;
- }
}
@Override
return this.bgpAppPeerSingletonService.getPeerState();
}
- synchronized void setServiceRegistration(final ServiceRegistration<?> serviceRegistration) {
- this.serviceRegistration = serviceRegistration;
- }
-
private static final class BgpAppPeerSingletonService implements BGPPeerStateConsumer {
private final ApplicationPeer applicationPeer;
private final DOMDataTreeChangeService dataTreeChangeService;