use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.l3vpn.lb.nexthops.NexthopsKey in project netvirt by opendaylight.
the class FibUtil method removeOrUpdateNextHopInfo.
public static void removeOrUpdateNextHopInfo(BigInteger dpnId, String nextHopKey, String groupId, Nexthops nexthops, WriteTransaction tx) {
InstanceIdentifier<Nexthops> nextHopsId = getNextHopsIdentifier(nextHopKey);
List<String> targetDeviceIds = nexthops.getTargetDeviceId();
targetDeviceIds.remove(dpnId.toString());
if (targetDeviceIds.isEmpty()) {
tx.delete(LogicalDatastoreType.OPERATIONAL, nextHopsId);
} else {
Nexthops nextHopsToGroupId = new NexthopsBuilder().setKey(new NexthopsKey(nextHopKey)).setNexthopKey(nextHopKey).setGroupId(groupId).setTargetDeviceId(targetDeviceIds).build();
tx.put(LogicalDatastoreType.OPERATIONAL, nextHopsId, nextHopsToGroupId);
}
}
Aggregations