if (hwVtepDevice == null || hwVtepDevice.getInterfaces() == null || hwVtepDevice.getInterfaces().isEmpty()) { String errMsg = "HwVtepDevice is null or interfaces are empty."; LOG.error(errMsg); return Futures.immediateFailedFuture(new RuntimeException(errMsg)); NodeId physicalSwitchNodeId = HwvtepSouthboundUtils.createManagedNodeId(nodeId, hwVtepDevice.getDeviceName()); .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) { String phyPortName = deviceInterface.getInterfaceName(); if (deviceInterface.getSegmentationIds() != null && !deviceInterface.getSegmentationIds().isEmpty()) {
final List<NeutronL2gatewayDeviceInterface> neutronL2gatewayDeviceInterfaces = new ArrayList<NeutronL2gatewayDeviceInterface>(); if (device.getDeviceName() != null){ neutronL2gatewayDevice.setDeviceName(device.getDeviceName().toString()); if (device.getUuid() != null) { neutronL2gatewayDevice.setID(device.getUuid().getValue()); if(device.getInterfaces() != null){ for(final Interfaces deviceInterface:device.getInterfaces()){ final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface = new NeutronL2gatewayDeviceInterface();
private void addL2Device(Devices l2Device, L2gateway input) { final String l2DeviceName = l2Device.getDeviceName(); L2GatewayDevice l2GwDevice = L2GatewayCacheUtils.getL2DeviceFromCache(l2DeviceName); if (l2GwDevice != null) {
String l2DeviceName = l2Device.getDeviceName();
if (hwVtepDevice == null || hwVtepDevice.getInterfaces() == null || hwVtepDevice.getInterfaces().isEmpty()) { String errMsg = "HwVtepDevice is null or interfaces are empty."; LOG.error(errMsg); .l2gateway.attributes.devices.Interfaces deviceInterface : hwVtepDevice.getInterfaces()) { NodeId physicalSwitchNodeId = HwvtepSouthboundUtils.createManagedNodeId(nodeId, hwVtepDevice.getDeviceName()); TerminationPoint portTerminationPoint = HwvtepUtils.getPhysicalPortTerminationPoint(broker, LogicalDatastoreType.OPERATIONAL, physicalSwitchNodeId, deviceInterface.getInterfaceName()); HwvtepUtils.mergeVlanBindings(transaction, nodeId, hwVtepDevice.getDeviceName(), deviceInterface.getInterfaceName(), vlanBindings);
private void disAssociateHwvtepsFromElan(ElanInstance elanInstance, L2gateway l2Gateway, L2gatewayConnection input) { String elanName = elanInstance.getElanInstanceName(); Integer defaultVlan = input.getSegmentId(); List<Devices> l2Devices = l2Gateway.getDevices(); for (Devices l2Device : l2Devices) { String l2DeviceName = l2Device.getDeviceName(); L2GatewayDevice l2GatewayDevice = L2GatewayCacheUtils.getL2DeviceFromCache(l2DeviceName); String hwvtepNodeId = l2GatewayDevice.getHwvtepNodeId(); boolean isLastL2GwConnDeleted = false; L2GatewayDevice elanL2GwDevice = ElanL2GwCacheUtils.getL2GatewayDeviceFromCache(elanName, hwvtepNodeId); if (isLastL2GwConnBeingDeleted(elanL2GwDevice)) { // Delete L2 Gateway device from 'ElanL2GwDevice' cache LOG.debug("Elan L2Gw Conn cache removed for id {}", hwvtepNodeId); ElanL2GwCacheUtils.removeL2GatewayDeviceFromCache(elanName, hwvtepNodeId); isLastL2GwConnDeleted = true; } else { Uuid l2GwConnId = input.getKey().getUuid(); LOG.debug("Elan L2Gw Conn cache with id {} is being referred by other L2Gw Conns; so only " + "L2 Gw Conn {} reference is removed", hwvtepNodeId, l2GwConnId); elanL2GwDevice.removeL2GatewayId(l2GwConnId); } DisAssociateHwvtepFromElanJob disAssociateHwvtepToElanJob = new DisAssociateHwvtepFromElanJob(broker, elanL2GatewayUtils, elanL2GatewayMulticastUtils, elanL2GwDevice, elanInstance, l2Device, defaultVlan, isLastL2GwConnDeleted); ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, disAssociateHwvtepToElanJob.getJobKey(), "remove l2gw connection job ", disAssociateHwvtepToElanJob); } }
List<Devices> l2Devices = l2Gateway.getDevices(); for (Devices l2Device : l2Devices) { String l2DeviceName = l2Device.getDeviceName(); if (l2DeviceName != null && l2DeviceName.equals(psName)) { for (Interfaces deviceInterface : l2Device.getInterfaces()) { if (deviceInterface.getInterfaceName().equals(newPortId)) { if (deviceInterface.getSegmentationIds() != null
private void removeL2Device(Devices l2Device, L2gateway input) { final String l2DeviceName = l2Device.getDeviceName(); L2GatewayDevice l2GwDevice = L2GatewayCacheUtils.getL2DeviceFromCache(l2DeviceName); if (l2GwDevice != null) {