use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef 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.HwvtepLogicalSwitchRef in project netvirt by opendaylight.
the class RemoteMcastCmd method generateId.
@Override
public InstanceIdentifier<RemoteMcastMacs> generateId(InstanceIdentifier<Node> id, RemoteMcastMacs node) {
HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
RemoteMcastMacsKey key = new RemoteMcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(RemoteMcastMacs.class, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef in project netvirt by opendaylight.
the class RemoteUcastCmd method generateId.
@Override
public InstanceIdentifier<RemoteUcastMacs> generateId(InstanceIdentifier<Node> id, RemoteUcastMacs node) {
HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
RemoteUcastMacsKey key = new RemoteUcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef in project netvirt by opendaylight.
the class ElanL2GatewayUtils method readRemoteMcastMac.
/**
* Gets the remote mcast mac.
*
* @param nodeId
* the node id
* @param logicalSwitchName
* the logical switch name
* @param datastoreType
* the datastore type
* @return the remote mcast mac
*/
public RemoteMcastMacs readRemoteMcastMac(NodeId nodeId, String logicalSwitchName, LogicalDatastoreType datastoreType) {
InstanceIdentifier<LogicalSwitches> logicalSwitch = HwvtepSouthboundUtils.createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName));
RemoteMcastMacsKey remoteMcastMacsKey = new RemoteMcastMacsKey(new HwvtepLogicalSwitchRef(logicalSwitch), new MacAddress(ElanConstants.UNKNOWN_DMAC));
return HwvtepUtils.getRemoteMcastMac(broker, datastoreType, nodeId, remoteMcastMacsKey);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef in project netvirt by opendaylight.
the class PhysicalSwitchHelper method createVlanBinding.
public static VlanBindings createVlanBinding(Long key, String logicalSwitch) {
VlanBindingsBuilder vbBuilder = new VlanBindingsBuilder();
VlanBindingsKey vbKey = new VlanBindingsKey(new VlanId(key.intValue()));
vbBuilder.setKey(vbKey);
vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
HwvtepLogicalSwitchRef hwvtepLogicalSwitchRef = new HwvtepLogicalSwitchRef(createInstanceIdentifier(logicalSwitch));
vbBuilder.setLogicalSwitchRef(hwvtepLogicalSwitchRef);
return vbBuilder.build();
}
Aggregations