Search in sources :

Example 1 with DhcpAllocationPoolAddJob

use of org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolAddJob in project netvirt by opendaylight.

the class DhcpAllocationPoolListener method add.

@Override
protected void add(InstanceIdentifier<AllocationPool> key, AllocationPool dataObjectModification) {
    String networkId = key.firstKeyOf(Network.class).getNetworkId();
    dhcpAllocationPoolManager.createIdAllocationPool(networkId, dataObjectModification);
    Map<BigInteger, List<String>> elanDpnInterfacesByName = getDpnInterfacesByNetwork(networkId);
    for (Entry<BigInteger, List<String>> entry : elanDpnInterfacesByName.entrySet()) {
        BigInteger dpnId = entry.getKey();
        for (String interfaceName : entry.getValue()) {
            LOG.debug("Install Dhcp Entries for dpId: {} interface : {}", dpnId, interfaceName);
            DhcpAllocationPoolAddJob job = new DhcpAllocationPoolAddJob(txRunner, interfaceName);
            jobCoordinator.enqueueJob(DhcpServiceUtils.getJobKey(interfaceName), job, DhcpMConstants.RETRY_COUNT);
        }
    }
}
Also used : Network(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.Network) BigInteger(java.math.BigInteger) DhcpAllocationPoolAddJob(org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolAddJob) List(java.util.List)

Aggregations

BigInteger (java.math.BigInteger)1 List (java.util.List)1 DhcpAllocationPoolAddJob (org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolAddJob)1 Network (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.Network)1