private void registerListener(final DataBroker db) {
try {
- listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
+ listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
getWildCardPath(), VpnInterfaceChangeListener.this, DataChangeScope.SUBTREE);
} catch (final Exception e) {
LOG.error("Nexthop Manager DataChange listener registration fail!", e);
@Override
protected void add(InstanceIdentifier<Adjacencies> identifier,
Adjacencies adjs) {
-
+ LOG.trace("Adding adjacencies interface : key: " + identifier + ", value=" + adjs );
InstanceIdentifier<VpnInterface> vpnIfId = identifier.firstIdentifierOf(VpnInterface.class);
- Optional<VpnInterface> vpnIf = read(LogicalDatastoreType.CONFIGURATION, vpnIfId);
+ Optional<VpnInterface> vpnIf = read(LogicalDatastoreType.OPERATIONAL, vpnIfId);
VpnInterface vpnIfData = vpnIf.get();
List<Adjacency> adjList = adjs.getAdjacency();
@Override
protected void remove(InstanceIdentifier<Adjacencies> identifier,
Adjacencies adjs) {
- InstanceIdentifier<VpnInterface> vpnIfId = identifier.firstIdentifierOf(VpnInterface.class);
- Optional<VpnInterface> vpnIf = read(LogicalDatastoreType.CONFIGURATION, vpnIfId);
- VpnInterface vpnIfData = vpnIf.get();
-
- List<Adjacency> adjList = adjs.getAdjacency();
- for (Adjacency adjacency : adjList) {
- nexthopManager.removeLocalNextHop(vpnIfData.getVpnInstanceName(), adjacency.getIpAddress());
- }
-
+ // nexthop group will be removed after fib entry deletion
}
@Override