use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName in project netvirt by opendaylight.
the class LocalMcastCmd method areEqual.
@Override
public boolean areEqual(LocalMcastMacs updated, LocalMcastMacs orig) {
InstanceIdentifier<?> updatedMacRefIdentifier = updated.getLogicalSwitchRef().getValue();
HwvtepNodeName updatedMacNodeName = updatedMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
InstanceIdentifier<?> origMacRefIdentifier = orig.getLogicalSwitchRef().getValue();
HwvtepNodeName origMacNodeName = origMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
if (updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName)) {
List<LocatorSet> updatedLocatorSet = updated.getLocatorSet();
List<LocatorSet> origLocatorSet = orig.getLocatorSet();
if (!areSameSize(updatedLocatorSet, origLocatorSet)) {
return false;
}
List<LocatorSet> added = diffOf(updatedLocatorSet, origLocatorSet, locatorSetComparator);
if (!HwvtepHAUtil.isEmptyList(added)) {
return false;
}
List<LocatorSet> removed = diffOf(origLocatorSet, updatedLocatorSet, locatorSetComparator);
if (!HwvtepHAUtil.isEmptyList(removed)) {
return false;
}
return true;
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName in project netvirt by opendaylight.
the class RemoteMcastCmd method areEqual.
@Override
public boolean areEqual(RemoteMcastMacs updated, RemoteMcastMacs orig) {
InstanceIdentifier<?> updatedMacRefIdentifier = updated.getLogicalSwitchRef().getValue();
HwvtepNodeName updatedMacNodeName = updatedMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
InstanceIdentifier<?> origMacRefIdentifier = orig.getLogicalSwitchRef().getValue();
HwvtepNodeName origMacNodeName = origMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
if (updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName)) {
List<LocatorSet> updatedLocatorSet = updated.getLocatorSet();
List<LocatorSet> origLocatorSet = orig.getLocatorSet();
if (!areSameSize(updatedLocatorSet, origLocatorSet)) {
return false;
}
List<LocatorSet> added = diffOf(updatedLocatorSet, origLocatorSet, locatorSetComparator);
if (!HwvtepHAUtil.isEmptyList(added)) {
return false;
}
List<LocatorSet> removed = diffOf(origLocatorSet, updatedLocatorSet, locatorSetComparator);
if (!HwvtepHAUtil.isEmptyList(removed)) {
return false;
}
return true;
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName in project netvirt by opendaylight.
the class DeleteLogicalSwitchJob method call.
@Override
public List<ListenableFuture<Void>> call() {
if (cancelled) {
LOG.info("Delete logical switch job cancelled ");
return Collections.emptyList();
}
LOG.debug("running logical switch deleted job for {} in {}", logicalSwitchName, hwvtepNodeId);
elanL2GatewayUtils.deleteElanMacsFromL2GatewayDevice(hwvtepNodeId.getValue(), logicalSwitchName);
InstanceIdentifier<LogicalSwitches> logicalSwitch = HwvtepSouthboundUtils.createLogicalSwitchesInstanceIdentifier(hwvtepNodeId, new HwvtepNodeName(logicalSwitchName));
RemoteMcastMacsKey remoteMcastMacsKey = new RemoteMcastMacsKey(new HwvtepLogicalSwitchRef(logicalSwitch), new MacAddress(ElanConstants.UNKNOWN_DMAC));
HwvtepUtils.deleteRemoteMcastMac(broker, hwvtepNodeId, remoteMcastMacsKey);
L2GatewayDevice l2GatewayDevice = new L2GatewayDevice("");
l2GatewayDevice.setHwvtepNodeId(hwvtepNodeId.getValue());
List<ListenableFuture<Void>> futures = new ArrayList<>();
futures.add(HwvtepUtils.deleteLogicalSwitch(broker, hwvtepNodeId, logicalSwitchName));
if (clearUcast) {
LOG.trace("Clearing the local ucast macs of device {} macs ", hwvtepNodeId.getValue());
elanL2GatewayUtils.deleteL2GwDeviceUcastLocalMacsFromElan(l2GatewayDevice, logicalSwitchName);
}
return futures;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName in project netvirt by opendaylight.
the class L2GwValidateCli method verifyMcastMac.
private boolean verifyMcastMac(String logicalSwitchName, InstanceIdentifier<Node> nodeIid) {
NodeId nodeId = nodeIid.firstKeyOf(Node.class).getNodeId();
HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(HwvtepSouthboundUtils.createLogicalSwitchesInstanceIdentifier(new NodeId(new Uri(nodeId)), new HwvtepNodeName(logicalSwitchName)));
RemoteMcastMacs remoteMcastMac = new RemoteMcastMacsBuilder().setMacEntryKey(new MacAddress(ElanConstants.UNKNOWN_DMAC)).setLogicalSwitchRef(lsRef).build();
InstanceIdentifier<RemoteMcastMacs> mcastMacIid = HwvtepSouthboundUtils.createRemoteMcastMacsInstanceIdentifier(new NodeId(new Uri(nodeId)), remoteMcastMac.getKey());
if (!isPresent(configNodesData, nodeIid, mcastMacIid)) {
pw.println("Failed to find config mcast mac for logical switch " + logicalSwitchName + " node id " + nodeId.getValue());
return false;
}
if (!isPresent(operationalNodesData, nodeIid, mcastMacIid)) {
pw.println("Failed to find operational mcast mac for logical switch " + logicalSwitchName + " node id " + nodeId.getValue());
return false;
}
return true;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName in project genius by opendaylight.
the class HwvtepSouthboundUtils method createLogicalSwitch.
/**
* Create logical switch.
*
* @param name
* the name
* @param desc
* the desc
* @param tunnelKey
* the tunnel key
* @return the logical switches
*/
public static LogicalSwitches createLogicalSwitch(String name, String desc, String tunnelKey, String replicationMode) {
HwvtepNodeName hwvtepName = new HwvtepNodeName(name);
LogicalSwitchesBuilder lsBuilder = new LogicalSwitchesBuilder().setHwvtepNodeDescription(desc).setHwvtepNodeName(hwvtepName).setKey(new LogicalSwitchesKey(hwvtepName)).setTunnelKey(tunnelKey);
if (replicationMode != null && !replicationMode.isEmpty()) {
lsBuilder.setReplicationMode(replicationMode);
}
return lsBuilder.build();
}
Aggregations