use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.underlay.networks.underlay.network.DpnToInterfaceBuilder in project netvirt by opendaylight.
the class PolicyServiceUtil method updateTunnelInterfacesForUnderlayNetwork.
public void updateTunnelInterfacesForUnderlayNetwork(String underlayNetwork, BigInteger srcDpId, List<TunnelInterface> tunnelInterfaces, boolean isAdded) {
coordinator.enqueueJob(underlayNetwork, () -> {
InstanceIdentifier<DpnToInterface> identifier = getUnderlayNetworkDpnIdentifier(underlayNetwork, srcDpId);
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
if (isAdded) {
DpnToInterface dpnToInterface = new DpnToInterfaceBuilder().setDpId(srcDpId).setTunnelInterface(tunnelInterfaces).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, identifier, dpnToInterface, true);
LOG.info("Add tunnel interfaces {} on DPN {} to underlay network {}", tunnelInterfaces, srcDpId, underlayNetwork);
} else {
tx.delete(LogicalDatastoreType.OPERATIONAL, identifier);
LOG.info("Remove tunnel interfaces {} from DPN {} on underlay network {}", tunnelInterfaces, srcDpId, underlayNetwork);
}
return Collections.singletonList(tx.submit());
});
}
Aggregations