Change-Id: Icac4957a2e68499cc2a438e4ea3b516d725a4854
Signed-off-by: Tomas Cere <tcere@cisco.com>
new ServiceTracker<>(context, NetconfNotificationCollector.class, new ServiceTrackerCustomizer<NetconfNotificationCollector, NetconfNotificationCollector>() {
@Override
public NetconfNotificationCollector addingService(ServiceReference<NetconfNotificationCollector> reference) {
- Preconditions.checkState(listenerReg != null, "Notification collector service was already added");
+ Preconditions.checkState(listenerReg == null, "Notification collector service was already added");
listenerReg = context.getService(reference).registerBaseNotificationPublisher();
monitoringService.setNotificationPublisher(listenerReg);
return null;