private Subnets findSubnets(List<Subnets> subnets, String subnetIp) { for (Subnets subnet : subnets) { IpPrefix subnetPrefix = new IpPrefix(subnetIp.toCharArray()); if (subnet.getPrefix().equals(subnetPrefix)) { return subnet; } } Subnets retSubnet = newSubnets(subnetIp); subnets.add(retSubnet); return retSubnet; }
return false; if (!Objects.equals(_prefix, other.getPrefix())) { return false;
public SubnetsBuilder(Subnets base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); if (base instanceof SubnetsImpl) { SubnetsImpl impl = (SubnetsImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if(subnetsList!=null){ for (Subnets subnet : subnetsList) { IpPrefix ipPrefix = subnet.getPrefix(); IpAddress gatewayIP = subnet.getGatewayIp(); int vlanID = subnet.getVlanId();
if (subnetsList != null) { for (Subnets subnet : subnetsList) { IpPrefix ipPrefix = subnet.getPrefix(); IpAddress gatewayIP = subnet.getGatewayIp(); int vlanID = subnet.getVlanId();
LOG.error("Transport Zone " + tZ.getZoneName() + "subnet " + sub.getPrefix() + "has no vteps"); continue; strTunnelType = ITMConstants.TUNNEL_TYPE_VXLAN ; result.add(String.format("%-16s %-16s %-16s %-12s %-12s %-12s %-16s %-12s", tZ.getZoneName(), strTunnelType, sub .getPrefix().getIpv4Prefix().getValue(), sub.getGatewayIp().getIpv4Address() .getValue(), sub.getVlanId().toString(), vtep.getDpnId().toString(), vtep .getIpAddress().getIpv4Address().getValue(), vtep.getPortname().toString()));
for (DeviceVteps deviceVtep : sub.getDeviceVteps()) { HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
for (DeviceVteps deviceVtep : sub.getDeviceVteps()) { HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
for (DeviceVteps deviceVtep : sub.getDeviceVteps()) { HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
logger.trace("wire up {} and {}",tep, hwVtepDS); if (!wireUp(dpn.getDPNID(), tep.getPortname(), sub.getVlanId(), tep.getIpAddress(), nodeId, hwVtepDS.getIpAddress(), tep.getSubnetMask(), sub.getGatewayIp(), sub.getPrefix(), tZone.getTunnelType(),monitorEnabled, monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL, idManagerService, dataBroker, futures, t)) logger.error("Unable to build tunnel {} -- {}", tep.getIpAddress(), hwVtepDS.getIpAddress()); if (!wireUp(hwVtepDS.getTopologyId(), hwVtepDS.getNodeId(), hwVtepDS.getIpAddress(), cssID, tep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), tep.getSubnetMask(), tZone.getTunnelType(), monitorEnabled, monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL, idManagerService, dataBroker, futures, t)) logger.error("Unable to build tunnel {} -- {}", hwVtepDS.getIpAddress(), tep.getIpAddress());
logger.trace("wire up {} and {}",hwTep, hwVtepDS); if (!wireUp(hwTep.getTopo_id(), hwTep.getNode_id(), hwTep.getHwIp(), hwVtepDS.getNodeId(), hwVtepDS.getIpAddress(), hwTep.getIpPrefix(), hwTep.getGatewayIP(), sub.getPrefix(), tunType,monitorEnabled,monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL, idManagerService, dataBroker, futures, t)) logger.error("Unable to build tunnel {} -- {}", hwTep.getHwIp(), hwVtepDS.getIpAddress()); sub.getPrefix(), sub.getGatewayIp(), hwTep.getIpPrefix(), tunType, monitorEnabled,monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL, idManagerService, dataBroker, futures, t)) logger.error("Unable to build tunnel {} -- {}", hwVtepDS.getIpAddress(), hwTep.getHwIp()); logger.trace("wire up {} and {}",hwTep, vtep); if(!wireUp(hwTep.getTopo_id(), hwTep.getNode_id(), hwTep.getHwIp(), cssID, vtep.getIpAddress(), hwTep.getIpPrefix(), hwTep.getGatewayIP(), sub.getPrefix(), tunType,monitorEnabled, monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL, idManagerService, dataBroker, futures, t )) logger.error("Unable to build tunnel {} -- {}", hwTep.getHwIp(), vtep.getIpAddress()); hwTep.getNode_id(),hwTep.getHwIp(),sub.getPrefix(), sub.getGatewayIp(),hwTep.getIpPrefix(), tunType,monitorEnabled,monitorProtocol, ITMConstants.BFD_DEFAULT_MONITOR_INTERVAL,idManagerService, dataBroker, futures, t ));