use of org.opendaylight.controller.config.util.capability.ModuleListener in project controller by opendaylight.
the class YangStoreService method notifyListeners.
void notifyListeners(final YangStoreSnapshot previous, final YangStoreSnapshot current) {
final Set<Module> prevModules = previous.getModules();
final Set<Module> currModules = current.getModules();
final Set<Module> removed = Sets.difference(prevModules, currModules);
final Set<Module> added = Sets.difference(currModules, prevModules);
final Set<Capability> addedCaps = toCapabilities(added, current);
final Set<Capability> removedCaps = toCapabilities(removed, current);
synchronized (this.listeners) {
for (final ModuleListener listener : this.listeners) {
listener.onCapabilitiesChanged(addedCaps, removedCaps);
}
}
}
Aggregations