Search in sources :

Example 1 with DhcpAllocationPoolRemoveJob

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

the class DhcpAllocationPoolListener method remove.

@Override
protected void remove(InstanceIdentifier<AllocationPool> key, AllocationPool dataObjectModification) {
    String networkId = key.firstKeyOf(Network.class).getNetworkId();
    dhcpAllocationPoolManager.releaseIdAllocationPool(networkId, dataObjectModification);
    Map<BigInteger, List<String>> elanDpnInterfacesByName = getDpnInterfacesByNetwork(networkId);
    elanDpnInterfacesByName.values().forEach(interfaceNames -> interfaceNames.forEach(interfaceName -> {
        DhcpAllocationPoolRemoveJob job = new DhcpAllocationPoolRemoveJob(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) DhcpAllocationPool(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.DhcpAllocationPool) Logger(org.slf4j.Logger) ManagedNewTransactionRunner(org.opendaylight.genius.infra.ManagedNewTransactionRunner) DhcpMConstants(org.opendaylight.netvirt.dhcpservice.api.DhcpMConstants) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) JobCoordinator(org.opendaylight.infrautils.jobcoordinator.JobCoordinator) LoggerFactory(org.slf4j.LoggerFactory) AsyncDataTreeChangeListenerBase(org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) List(java.util.List) AllocationPool(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.network.AllocationPool) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) DhcpAllocationPoolRemoveJob(org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolRemoveJob) Map(java.util.Map) ManagedNewTransactionRunnerImpl(org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl) Entry(java.util.Map.Entry) BigInteger(java.math.BigInteger) DhcpAllocationPoolAddJob(org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolAddJob) DhcpAllocationPoolRemoveJob(org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolRemoveJob) Network(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.Network) BigInteger(java.math.BigInteger) List(java.util.List)

Aggregations

BigInteger (java.math.BigInteger)1 List (java.util.List)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)1 AsyncDataTreeChangeListenerBase (org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase)1 ManagedNewTransactionRunner (org.opendaylight.genius.infra.ManagedNewTransactionRunner)1 ManagedNewTransactionRunnerImpl (org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl)1 JobCoordinator (org.opendaylight.infrautils.jobcoordinator.JobCoordinator)1 DhcpMConstants (org.opendaylight.netvirt.dhcpservice.api.DhcpMConstants)1 DhcpAllocationPoolAddJob (org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolAddJob)1 DhcpAllocationPoolRemoveJob (org.opendaylight.netvirt.dhcpservice.jobs.DhcpAllocationPoolRemoveJob)1 DhcpAllocationPool (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.DhcpAllocationPool)1 Network (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.Network)1 AllocationPool (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.dhcp_allocation_pool.rev161214.dhcp_allocation_pool.network.AllocationPool)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1