Search in sources :

Example 1 with ModuleListener

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);
        }
    }
}
Also used : ModuleListener(org.opendaylight.controller.config.util.capability.ModuleListener) Capability(org.opendaylight.controller.config.util.capability.Capability) YangModuleCapability(org.opendaylight.controller.config.util.capability.YangModuleCapability) Module(org.opendaylight.yangtools.yang.model.api.Module)

Aggregations

Capability (org.opendaylight.controller.config.util.capability.Capability)1 ModuleListener (org.opendaylight.controller.config.util.capability.ModuleListener)1 YangModuleCapability (org.opendaylight.controller.config.util.capability.YangModuleCapability)1 Module (org.opendaylight.yangtools.yang.model.api.Module)1