Search in sources :

Example 11 with LogicalSwitches

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches in project netvirt by opendaylight.

the class ElanL2GatewayUtils method getElanInstanceForUcastLocalMac.

public ElanInstance getElanInstanceForUcastLocalMac(LocalUcastMacs localUcastMac) {
    Optional<LogicalSwitches> lsOpc = ElanUtils.read(broker, LogicalDatastoreType.OPERATIONAL, (InstanceIdentifier<LogicalSwitches>) localUcastMac.getLogicalSwitchRef().getValue());
    if (lsOpc.isPresent()) {
        LogicalSwitches ls = lsOpc.get();
        // Logical switch name is Elan name
        String elanName = getElanFromLogicalSwitch(ls.getHwvtepNodeName().getValue());
        return elanInstanceCache.get(elanName).orNull();
    }
    return null;
}
Also used : LogicalSwitches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches)

Example 12 with LogicalSwitches

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches in project netvirt by opendaylight.

the class LogicalSwitchesCmdTest method buildData.

LogicalSwitches buildData(String name, String tunnelKey) {
    LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder();
    logicalSwitchesBuilder.setKey(new LogicalSwitchesKey(new HwvtepNodeName(name)));
    logicalSwitchesBuilder.setTunnelKey(tunnelKey);
    logicalSwitchesBuilder.setHwvtepNodeName(new HwvtepNodeName(name));
    return logicalSwitchesBuilder.build();
}
Also used : LogicalSwitchesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesBuilder) HwvtepNodeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName) LogicalSwitchesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey)

Example 13 with LogicalSwitches

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches in project netvirt by opendaylight.

the class PhysicalSwitchHelper method createInstanceIdentifier.

public static InstanceIdentifier<LogicalSwitches> createInstanceIdentifier(String logicalSwitch) {
    NodeId id = dId.firstKeyOf(Node.class).getNodeId();
    NodeKey nodeKey = new NodeKey(id);
    InstanceIdentifier<LogicalSwitches> iid = null;
    iid = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)).child(Node.class, nodeKey).augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch))).build();
    return iid;
}
Also used : LogicalSwitches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) HwvtepGlobalAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) HwvtepNodeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) LogicalSwitchesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey)

Example 14 with LogicalSwitches

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches in project netvirt by opendaylight.

the class TestBuilders method buildLogicalSwitch.

public static LogicalSwitches buildLogicalSwitch(String logicalSwitch, String tunnelKey) {
    LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder();
    logicalSwitchesBuilder.setKey(new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch)));
    logicalSwitchesBuilder.setHwvtepNodeName(new HwvtepNodeName(logicalSwitch));
    logicalSwitchesBuilder.setTunnelKey(tunnelKey);
    Uuid lgoicalSwitchUuid = getUUid(logicalSwitch);
    logicalSwitchesBuilder.setLogicalSwitchUuid(lgoicalSwitchUuid);
    return logicalSwitchesBuilder.build();
}
Also used : Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) LogicalSwitchesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesBuilder) HwvtepNodeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName) LogicalSwitchesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey)

Example 15 with LogicalSwitches

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches in project netvirt by opendaylight.

the class LogicalSwitchesCmd method transform.

@Override
public LogicalSwitches transform(InstanceIdentifier<Node> nodePath, LogicalSwitches src) {
    LogicalSwitchesBuilder logicalSwitchesBuilder = new LogicalSwitchesBuilder(src);
    logicalSwitchesBuilder.setLogicalSwitchUuid(HwvtepHAUtil.getUUid(src.getHwvtepNodeName().getValue()));
    return logicalSwitchesBuilder.build();
}
Also used : LogicalSwitchesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesBuilder)

Aggregations

LogicalSwitches (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches)17 HwvtepNodeName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName)12 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)7 LogicalSwitchesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey)6 HwvtepLogicalSwitchRef (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef)5 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)4 LogicalSwitchesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesBuilder)4 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)4 ArrayList (java.util.ArrayList)3 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)3 HwvtepGlobalAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation)3 RemoteMcastMacsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteMcastMacsKey)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)2 HwvtepGlobalAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder)2 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 BigInteger (java.math.BigInteger)1 HashSet (java.util.HashSet)1 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)1