.build();
//TODO: Error handling
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
+ LOG.trace("NextHopPointerPool result : {}", result);
// try {
// LOG.info("Result2: {}",result.get());
// } catch (InterruptedException | ExecutionException e) {
Optional<VpnInstance1> vpn = read(LogicalDatastoreType.OPERATIONAL, idx);
if (vpn.isPresent()) {
+ LOG.debug("VPN id returned: {}", vpn.get().getVpnId());
return vpn.get().getVpnId();
} else {
return -1;
private long getDpnId(String ifName) {
String[] fields = ifName.split(":");
long dpn = Integer.parseInt(fields[1]);
+ LOG.debug("DpnId: {}", dpn);
return dpn;
}
listActionInfo.add(new ActionInfo(ActionType.pop_mpls, new String[]{}));
} else {
//FIXME: Log message here.
+ LOG.debug("mac address for new local nexthop is null");
}
listBucketInfo.add(bucket);
GroupEntity groupEntity = MDSALUtil.buildGroupEntity(
InstanceIdentifier<VpnNexthop> id1 = idBuilder
.child(VpnNexthop.class, new VpnNexthopKey(ipPrefix)).build();
- LOG.trace("Adding nextHop {} to Operational DS", nh);
+ LOG.trace("Adding vpnnextHop {} to Operational DS", nh);
asyncWrite(LogicalDatastoreType.OPERATIONAL, id1, nh, DEFAULT_CALLBACK);
}
.setKey(new TunnelNexthopsKey(dpnId))
.setDpnId(dpnId)
.build();
+ LOG.trace("Adding tunnelnextHop {} to Operational DS for a new node", node);
asyncWrite(LogicalDatastoreType.OPERATIONAL, id, node, DEFAULT_CALLBACK);
}
InstanceIdentifier<TunnelNexthop> id1 = idBuilder
.child(TunnelNexthop.class, new TunnelNexthopKey(ipPrefix)).build();
-
+ LOG.trace("Adding tunnelnextHop {} to Operational DS for a dpn node", nh);
asyncWrite(LogicalDatastoreType.OPERATIONAL, id1, nh, DEFAULT_CALLBACK);
}
for (VpnNexthop nexthop : nexthops) {
if (nexthop.getIpAddress().equals(ipAddress)) {
// return nexthop
+ LOG.trace("VpnNextHop : {}",nexthop);
return nexthop;
}
}
List<TunnelNexthop> nexthops = dpnNexthops.get().getTunnelNexthop();
for (TunnelNexthop nexthop : nexthops) {
if (nexthop.getIpAddress().equals(ipAddress)) {
+ LOG.trace("TunnelNextHop : {}",nexthop);
return nexthop;
}
}
return vpnNextHop.getEgressPointer();
} else {
TunnelNexthop tunnelNextHop = getTunnelNexthop(dpnId, nextHopIp);
+ LOG.trace("NExtHopPointer : {}", tunnelNextHop.getEgressPointer());
return tunnelNextHop.getEgressPointer();
}
}
.child(TunnelNexthop.class, new TunnelNexthopKey(ipPrefix));
InstanceIdentifier<TunnelNexthop> id = idBuilder.build();
// remove from DS
+ LOG.trace("Removing tunnel next hop from datastore : {}", id);
delete(LogicalDatastoreType.OPERATIONAL, id);
}
.child(VpnNexthop.class, new VpnNexthopKey(ipPrefix));
InstanceIdentifier<VpnNexthop> id = idBuilder.build();
// remove from DS
+ LOG.trace("Removing vpn next hop from datastore : {}", id);
delete(LogicalDatastoreType.OPERATIONAL, id);
}
removeVpnNexthopFromDS(vpnId, ipAddress);
} else {
//throw error
+ LOG.error("removal of local next hop failed");
}
}
removeTunnelNexthopFromDS(dpnId, ipAddress);
} else {
//throw error
+ LOG.error("removal of remote next hop failed : dpnid : {}, ipaddress : {}", dpnId, ipAddress);
}
}
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();