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);
}
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();
}
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);
}
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;
}
Aggregations