Search in sources :

Example 6 with HwvtepGlobalAugmentationBuilder

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

the class GlobalAugmentationHelper method addSwitches.

public static void addSwitches(HwvtepGlobalAugmentationBuilder augmentationBuilder, InstanceIdentifier<Node> psId) {
    List<Switches> switches = new ArrayList<>();
    SwitchesBuilder switchesBuilder = new SwitchesBuilder();
    switchesBuilder.setKey(new SwitchesKey(new HwvtepPhysicalSwitchRef(psId)));
    switchesBuilder.setSwitchRef(new HwvtepPhysicalSwitchRef(psId));
    switches.add(switchesBuilder.build());
    augmentationBuilder.setSwitches(switches);
}
Also used : HwvtepPhysicalSwitchRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalSwitchRef) SwitchesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesKey) LogicalSwitches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches) Switches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches) ArrayList(java.util.ArrayList) SwitchesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesBuilder)

Example 7 with HwvtepGlobalAugmentationBuilder

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

the class GlobalAugmentationHelper method updateLogicalSwitches.

public static Node updateLogicalSwitches(Node node, List<String> logicalSwitchData) {
    HwvtepGlobalAugmentationBuilder hwvtepGlobalAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
    List<LogicalSwitches> logicalSwitches = new ArrayList<>();
    for (int i = 0; i < logicalSwitchData.size(); i += 2) {
        logicalSwitches.add(TestBuilders.buildLogicalSwitch(logicalSwitchData.get(i), logicalSwitchData.get(i + 1)));
    }
    hwvtepGlobalAugmentationBuilder.setLogicalSwitches(logicalSwitches);
    NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(node.getNodeId());
    nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, hwvtepGlobalAugmentationBuilder.build());
    return nodeBuilder.build();
}
Also used : HwvtepGlobalAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder) LogicalSwitches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches) ArrayList(java.util.ArrayList) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 8 with HwvtepGlobalAugmentationBuilder

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

the class NodeConnectedHandlerUtils method addNode.

CheckedFuture<Void, TransactionCommitFailedException> addNode(InstanceIdentifier<Node> path, InstanceIdentifier<Node> psPath, String logicalSwitchData, String localUcasMacData, String localMcastData, String remoteMcastData, String remoteUcasteMacData, String globalTerminationPointIp, WriteTransaction transaction) throws Exception {
    NodeBuilder nodeBuilder = null;
    HwvtepGlobalAugmentationBuilder augmentationBuilder = null;
    nodeBuilder = prepareOperationalNode(path);
    augmentationBuilder = prepareAugmentationBuilder();
    GlobalAugmentationHelper.addLogicalSwitches(augmentationBuilder, getData(logicalSwitchData));
    GlobalAugmentationHelper.addLocalUcastMacs(path, augmentationBuilder, getData(localUcasMacData));
    GlobalAugmentationHelper.addLocalMcastMacs(path, augmentationBuilder, getData(localMcastData));
    GlobalAugmentationHelper.addRemoteMcastMacs(path, augmentationBuilder, getData(remoteMcastData));
    GlobalAugmentationHelper.addRemoteUcastMacs(path, augmentationBuilder, getData(remoteUcasteMacData));
    GlobalAugmentationHelper.addGlobalTerminationPoints(nodeBuilder, path, getData(globalTerminationPointIp));
    GlobalAugmentationHelper.addSwitches(augmentationBuilder, psPath);
    nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, augmentationBuilder.build());
    return TestUtil.submitNode(OPERATIONAL, path, nodeBuilder.build(), transaction);
}
Also used : HwvtepGlobalAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 9 with HwvtepGlobalAugmentationBuilder

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

the class NodeConnectedHandlerUtils method prepareAugmentationBuilder.

HwvtepGlobalAugmentationBuilder prepareAugmentationBuilder() {
    HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
    builder.setManagers(TestBuilders.buildManagers());
    return builder;
}
Also used : HwvtepGlobalAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder)

Aggregations

HwvtepGlobalAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder)8 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)6 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 HwvtepGlobalAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation)3 LogicalSwitches (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches)3 Optional (com.google.common.base.Optional)1 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)1 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)1 BatchedTransaction (org.opendaylight.netvirt.elan.l2gw.ha.BatchedTransaction)1 HwvtepPhysicalSwitchRef (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalSwitchRef)1 Managers (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Managers)1 Switches (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches)1 SwitchesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesBuilder)1 SwitchesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesKey)1