Search in sources :

Example 16 with L2gatewayConnection

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.l2gatewayconnections.L2gatewayConnection in project netvirt by opendaylight.

the class L2GatewayConnectionUtils method addL2GatewayConnection.

public void addL2GatewayConnection(final L2gatewayConnection input, final String l2GwDeviceName, L2gateway l2Gateway) {
    LOG.info("Adding L2gateway Connection with ID: {}", input.getKey().getUuid());
    Uuid networkUuid = input.getNetworkId();
    // Taking cluster reboot scenario , if Elan instance is not available when l2GatewayConnection add events
    // comes we need to wait for elaninstance to resolve. Hence updating the map with the runnable .
    // When elanInstance add comes , it look in to the map and run the associated runnable associated with it.
    ElanInstance elanInstance = elanInstanceCache.get(networkUuid.getValue(), () -> addL2GatewayConnection(input, l2GwDeviceName)).orNull();
    if (elanInstance == null) {
        return;
    }
    if (!isVxlanNetworkOrVxlanSegment(elanInstance)) {
        LOG.error("Neutron network with id {} is not VxlanNetwork", networkUuid.getValue());
    } else {
        Uuid l2GatewayId = input.getL2gatewayId();
        if (l2Gateway == null) {
            l2Gateway = getNeutronL2gateway(broker, l2GatewayId);
        }
        if (l2Gateway == null) {
            LOG.error("L2Gateway with id {} is not present", l2GatewayId.getValue());
        } else {
            associateHwvtepsToElan(elanInstance, l2Gateway, input, l2GwDeviceName);
        }
    }
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)

Aggregations

L2gatewayConnection (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.l2gatewayconnections.L2gatewayConnection)10 ArrayList (java.util.ArrayList)7 Devices (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.attributes.Devices)6 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)5 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)5 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)5 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)4 L2gateway (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateways.attributes.l2gateways.L2gateway)4 L2gatewayConnections (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.connections.attributes.L2gatewayConnections)3 VlanBindings (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindings)3 BigInteger (java.math.BigInteger)2 Nonnull (javax.annotation.Nonnull)2 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)2 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)2 Interfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateway.attributes.devices.Interfaces)2 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)2 Sets (com.google.common.collect.Sets)1 FutureCallback (com.google.common.util.concurrent.FutureCallback)1 Futures (com.google.common.util.concurrent.Futures)1 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1