use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey in project netvirt by opendaylight.
the class HwvtepHAUtil method convertLogicalSwitchRef.
/**
* Trnaform logical switch to nodepath passed .
*
* @param src {@link HwvtepLogicalSwitchRef} Logical Switch Ref which needs to be transformed
* @param nodePath {@link InstanceIdentifier} src needs to be transformed to this path
* @return ref {@link HwvtepLogicalSwitchRef} the transforrmed result
*/
public static HwvtepLogicalSwitchRef convertLogicalSwitchRef(HwvtepLogicalSwitchRef src, InstanceIdentifier<Node> nodePath) {
InstanceIdentifier<LogicalSwitches> srcId = (InstanceIdentifier<LogicalSwitches>) src.getValue();
HwvtepNodeName switchName = srcId.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
InstanceIdentifier<LogicalSwitches> iid = nodePath.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, new LogicalSwitchesKey(switchName));
HwvtepLogicalSwitchRef ref = new HwvtepLogicalSwitchRef(iid);
return ref;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey in project netvirt by opendaylight.
the class LogicalSwitchesCmdTest method setupForHANode.
@Before
public void setupForHANode() {
dataBroker = getDataBroker();
tx = Mockito.spy(dataBroker.newReadWriteTransaction());
for (int i = 0; i < 4; i++) {
logicalSwitches[i] = buildData(data[i][0], data[i][1]);
ids[i] = haNodePath.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(data[i][0])));
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesKey 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();
}
Aggregations