Search in sources :

Example 1 with DhcpInterfaceRemoveJob

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);
}
Also used : Port(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port) NodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId) BigInteger(java.math.BigInteger) DhcpInterfaceRemoveJob(org.opendaylight.netvirt.dhcpservice.jobs.DhcpInterfaceRemoveJob)

Aggregations

BigInteger (java.math.BigInteger)1 DhcpInterfaceRemoveJob (org.opendaylight.netvirt.dhcpservice.jobs.DhcpInterfaceRemoveJob)1 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)1 Port (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port)1