Search in sources :

Example 16 with TunnelInterface

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.underlay.networks.underlay.network.dpn.to._interface.TunnelInterface in project netvirt by opendaylight.

the class PolicyRouteGroupProgrammer method programPolicyClassifierGroupBuckets.

public void programPolicyClassifierGroupBuckets(String policyClassifier, List<String> underlayNetworks, int addOrRemove) {
    if (underlayNetworks == null) {
        return;
    }
    coordinator.enqueueJob(policyClassifier, () -> {
        WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
        for (int idx = 0; idx < underlayNetworks.size(); idx++) {
            final int bucketId = idx;
            String underlayNetwork = underlayNetworks.get(idx);
            List<DpnToInterface> dpnToInterfaceList = policyServiceUtil.getUnderlayNetworkDpnToInterfaces(underlayNetwork);
            dpnToInterfaceList.forEach(dpnToInterface -> {
                BigInteger dpId = dpnToInterface.getDpId();
                List<TunnelInterface> tunnelInterfaces = dpnToInterface.getTunnelInterface();
                programPolicyClassifierGroupBuckets(policyClassifier, tunnelInterfaces, dpId, bucketId, addOrRemove, tx);
            });
        }
        return Collections.singletonList(tx.submit());
    });
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) DpnToInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.underlay.networks.underlay.network.DpnToInterface) BigInteger(java.math.BigInteger) TunnelInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.underlay.networks.underlay.network.dpn.to._interface.TunnelInterface)

Aggregations

BigInteger (java.math.BigInteger)8 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)6 TunnelInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.underlay.networks.underlay.network.dpn.to._interface.TunnelInterface)6 IfTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel)5 ArrayList (java.util.ArrayList)4 Collections (java.util.Collections)4 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)4 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)4 ManagedNewTransactionRunner (org.opendaylight.genius.infra.ManagedNewTransactionRunner)4 ManagedNewTransactionRunnerImpl (org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl)4 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)4 Port (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 List (java.util.List)3 ExecutionException (java.util.concurrent.ExecutionException)3 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)3 IInterfaceManager (org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager)3 NwConstants (org.opendaylight.genius.mdsalutil.NwConstants)3