use of org.opendaylight.netvirt.dhcpservice.jobs.DhcpInterfaceRemoveJob in project netvirt by opendaylight.
the class DhcpInterfaceEventListener method remove.
@Override
protected void remove(InstanceIdentifier<Interface> identifier, Interface del) {
if (!L2vlan.class.equals(del.getType()) && !Tunnel.class.equals(del.getType())) {
return;
}
List<String> ofportIds = del.getLowerLayerIf();
if (ofportIds == null || ofportIds.isEmpty()) {
return;
}
String interfaceName = del.getName();
Port port = dhcpPortCache.get(interfaceName);
if (NeutronConstants.IS_DHCP_PORT.test(port)) {
return;
}
NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
BigInteger dpnId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
DhcpInterfaceRemoveJob job = new DhcpInterfaceRemoveJob(dhcpManager, dhcpExternalTunnelManager, dataBroker, del, dpnId, interfaceManager, elanService, port);
jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(interfaceName), job, DhcpMConstants.RETRY_COUNT);
dhcpPortCache.remove(interfaceName);
}
Aggregations