Search in sources :

Example 6 with RemoveFibEntryInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryInput in project netvirt by opendaylight.

the class FibRpcServiceImpl method removeFibEntry.

/**
 * To remove FIB/LFIB/TST routes from specified dpn.
 */
@Override
public Future<RpcResult<Void>> removeFibEntry(RemoveFibEntryInput input) {
    BigInteger dpnId = input.getSourceDpid();
    String vpnName = input.getVpnName();
    long vpnId = getVpnId(dataBroker, vpnName);
    String vpnRd = getVpnRd(dataBroker, vpnName);
    String ipAddress = input.getIpAddress();
    LOG.info("Delete custom FIB entry - {} on dpn {} for VPN {} ", ipAddress, dpnId, vpnName);
    LOG.info("REMOVE: Removing Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    removeLocalFibEntry(dpnId, vpnId, ipAddress);
    IpAddresses.IpAddressSource ipAddressSource = IpAddresses.IpAddressSource.forValue(input.getIpAddressSource().getIntValue());
    vpnFootprintService.updateVpnToDpnMapping(dpnId, vpnName, vpnRd, null, /* interfaceName*/
    new ImmutablePair<>(ipAddressSource, ipAddress), false);
    LOG.info("REMOVE: Removed Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}
Also used : IpAddresses(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpn.to.dpn.list.IpAddresses) BigInteger(java.math.BigInteger)

Aggregations

RemoveFibEntryInput (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryInput)5 RemoveFibEntryInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fib.rpc.rev160121.RemoveFibEntryInputBuilder)5 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)5 BigInteger (java.math.BigInteger)4 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)3 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)3 Optional (com.google.common.base.Optional)2 AsyncFunction (com.google.common.util.concurrent.AsyncFunction)2 FutureCallback (com.google.common.util.concurrent.FutureCallback)2 Futures (com.google.common.util.concurrent.Futures)2 JdkFutureAdapters (com.google.common.util.concurrent.JdkFutureAdapters)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 List (java.util.List)2 Future (java.util.concurrent.Future)2 Nonnull (javax.annotation.Nonnull)2 Inject (javax.inject.Inject)2 Singleton (javax.inject.Singleton)2