private void registerListener() {
final DataTreeIdentifier<ElanInterface> treeId =
new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getWildcardPath());
- try {
- LOG.trace("Registering on path: {}", treeId);
- registration = broker.registerDataTreeChangeListener(treeId, CacheElanInterfaceListener.this);
- } catch (final Exception e) {
- LOG.warn("CacheInterfaceConfigListener registration failed", e);
- }
+ LOG.trace("Registering on path: {}", treeId);
+ registration = broker.registerDataTreeChangeListener(treeId, CacheElanInterfaceListener.this);
}
protected InstanceIdentifier<ElanInterface> getWildcardPath() {
switch (mod.getModificationType()) {
case DELETE:
ElanUtils.removeElanInterfaceFromCache(mod.getDataBefore().getName());
+ ElanUtils.removeElanInterfaceToElanInstanceCache(mod.getDataBefore().getElanInstanceName(),
+ mod.getDataBefore().getName());
break;
case SUBTREE_MODIFIED:
case WRITE:
ElanInterface elanInterface = mod.getDataAfter();
ElanUtils.addElanInterfaceIntoCache(elanInterface.getName(), elanInterface);
+ ElanUtils.addElanInterfaceToElanInstanceCache(elanInterface.getElanInstanceName(),
+ elanInterface.getName());
break;
default:
throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());