import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteMcastMacs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteMcastMacsKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacsKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindings;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
for (String interfaceName : lstElanInterfaceNames) {
ElanInterfaceMac elanInterfaceMac = ElanUtils.getElanInterfaceMacByInterfaceName(broker, interfaceName);
if (elanInterfaceMac != null && elanInterfaceMac.getMacEntry() != null) {
- for (MacEntry macEntry : elanInterfaceMac.getMacEntry()) {
+ for (MacEntry macEntry : new ArrayList<MacEntry>(elanInterfaceMac.getMacEntry().values())) {
result.add(macEntry.getMacAddress());
}
}
HwvtepGlobalAugmentation augmentation = configNode.get().augmentation(
HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getLocalUcastMacs() != null) {
- macs.addAll(augmentation.getLocalUcastMacs().stream()
+ macs.addAll(new ArrayList<LocalUcastMacs>(augmentation
+ .getLocalUcastMacs().values()).stream()
.filter(mac -> getLogicalSwitchName(mac).equals(elanName))
.map(HwvtepMacTableGenericAttributes::getMacEntryKey)
.collect(Collectors.toSet()));
return Collections.emptyList();
}
if (hwvtepNode != null) {
- List<RemoteUcastMacs> remoteUcastMacs = hwvtepNode.augmentation(HwvtepGlobalAugmentation.class)
+ Map<RemoteUcastMacsKey, RemoteUcastMacs> keyRemoteUcastMacsMap
+ = hwvtepNode.augmentation(HwvtepGlobalAugmentation.class)
.getRemoteUcastMacs();
- if (remoteUcastMacs != null && !remoteUcastMacs.isEmpty()) {
- // Filtering remoteUcastMacs based on the logical switch and
+ if (keyRemoteUcastMacsMap != null && !keyRemoteUcastMacsMap.isEmpty()) {
+ // Filtering keyRemoteUcastMacsMap based on the logical switch and
// forming a list of MacAddress
- lstMacs = remoteUcastMacs.stream()
+ lstMacs = keyRemoteUcastMacsMap.values().stream()
.filter(mac -> logicalSwitch.equals(mac.getLogicalSwitchRef().getValue()
.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName().getValue()))
.map(HwvtepMacTableGenericAttributes::getMacEntryKey).collect(Collectors.toList());
return lstRemoteUcastMacs;
}
- for (MacEntry macEntry : macTable.getMacEntry()) {
+ for (MacEntry macEntry : new ArrayList<MacEntry>(macTable.getMacEntry().values())) {
Uint64 dpnId = getDpidFromInterface(macEntry.getInterface());
if (dpnId == null) {
LOG.error("DPN ID not found for interface {}", macEntry.getInterface());
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712
- .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) {
+ .l2gateway.attributes.devices.Interfaces deviceInterface : new ArrayList<>(hwVtepDevice
+ .getInterfaces().values())) {
//Removed the check for checking terminationPoint present in OP or not
//for coniguring vlan bindings
//As we are not any more dependent on it , plugin takes care of this
return txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712
- .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) {
+ .l2gateway.attributes.devices.Interfaces deviceInterface : new ArrayList<>(hwVtepDevice
+ .getInterfaces().values())) {
String phyPortName = deviceInterface.getInterfaceName();
if (deviceInterface.getSegmentationIds() != null && !deviceInterface.getSegmentationIds().isEmpty()) {
for (Integer vlanId : deviceInterface.getSegmentationIds()) {
String psNodeId = globalNodeId + HwvtepHAUtil.PHYSICALSWITCH + psName;
tzonesoptional.get().nonnullTransportZone().stream()
.filter(zone -> zone.getDeviceVteps() != null)
- .flatMap(zone -> zone.getDeviceVteps().stream())
+ .flatMap(zone -> new ArrayList<DeviceVteps>(zone.getDeviceVteps().values()).stream())
.filter(deviceVteps -> Objects.equals(getPsName(deviceVteps), psName)) //get device with same ps name
.filter(deviceVteps -> !Objects.equals(psNodeId, deviceVteps.getNodeId())
|| !Objects.equals(tunnelIp, deviceVteps.getIpAddress()))//node id or tunnel ip is changed
}
LoggingFutures.addErrorLogging(
new ManagedNewTransactionRunnerImpl(dataBroker).callWithNewReadWriteTransactionAndSubmit(CONFIGURATION,
- tx -> optionalElan.get().nonnullElanInstance().stream()
- .flatMap(elan -> elan.nonnullExternalTeps().stream()
+ tx -> optionalElan.get().nonnullElanInstance().values().stream()
+ .flatMap(elan -> elan.nonnullExternalTeps().values().stream()
.map(externalTep -> ElanL2GatewayMulticastUtils.buildExternalTepPath(
elan.getElanInstanceName(), externalTep.getTepIp())))
.filter(externalTepIid -> Objects.equals(
if (configNode.isPresent()) {
HwvtepGlobalAugmentation augmentation = configNode.get().augmentation(HwvtepGlobalAugmentation.class);
if (augmentation != null && augmentation.getLocalUcastMacs() != null) {
- macs.addAll(augmentation.getLocalUcastMacs().stream()
+ macs.addAll(augmentation.getLocalUcastMacs().values().stream()
.filter(mac -> getLogicalSwitchName(mac).equals(elanName))
.map(HwvtepMacTableGenericAttributes::getMacEntryKey)
.collect(Collectors.toSet()));