/** * Checks if is gre tunnel type. * * @param tZoneName * the zone name * @param tZoneMap * the zone map * @return true, if is gre tunnel type */ private boolean isGreTunnelType(String tZoneName, Map<String, TransportZone> tZoneMap) { TransportZone tzone = tZoneMap.get(tZoneName); /* if (tzone != null && StringUtils.equalsIgnoreCase(ITMConstants.TUNNEL_TYPE_GRE, tzone.getTunnelType())) { return true; } */ if( (tzone != null) && (tzone.getTunnelType()).equals(TunnelTypeGre.class) ) { return true; } return false; }
@Override protected void add(InstanceIdentifier<TransportZone> key, TransportZone tzNew) { if (LOG.isTraceEnabled()) { LOG.trace("Received Transport Zone Add Event: {}", tzNew); } if (tzNew.getTunnelType().equals(TunnelTypeVxlan.class)) { DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance(); AddL2GwDevicesToTransportZoneJob job = new AddL2GwDevicesToTransportZoneJob(dataBroker, itmRpcService, tzNew); coordinator.enqueueJob(job.getJobKey(), job); } }
if( (!tZoneFromConfigDS.getTunnelType().equals(tunType)) && ItmUtils.isNotEmpty(tZoneFromConfigDS.getSubnets())) { String errorMsg = new StringBuilder("Changing the tunnel type from ").append(tZoneFromConfigDS.getTunnelType()) .append(" to ").append(strTunnelType) .append(" is not allowed for already configured transport zone [").append(tZoneName)
return false; if (!Objects.equals(_tunnelType, other.getTunnelType())) { return false;
public TransportZoneBuilder(TransportZone base) { if (base.getKey() == null) { this._key = new TransportZoneKey( base.getZoneName() ); this._zoneName = base.getZoneName(); } else { this._key = base.getKey(); this._zoneName = _key.getZoneName(); } this._subnets = base.getSubnets(); this._tunnelType = base.getTunnelType(); if (base instanceof TransportZoneImpl) { TransportZoneImpl impl = (TransportZoneImpl) 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.TransportZone> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
Class<? extends TunnelTypeBase> tunnel_type = transportZone.getTunnelType(); LOG.trace("Transport Zone_name: {}", zone_name); List<Subnets> subnetsList = transportZone.getSubnets();
if (tZ.getTunnelType().equals(TunnelTypeGre.class)) { isGreType = true;
Class<? extends TunnelTypeBase> tunnel_type = transportZone.getTunnelType(); LOG.trace("Transport Zone_name: {}", zone_name); List<Subnets> subnetsList = transportZone.getSubnets();
for (Vteps vtepRemote : sub.getVteps()) { if (!vtepLocal.equals(vtepRemote)) { InternalTunnelKey key = new InternalTunnelKey(vtepRemote.getDpnId(), vtepLocal.getDpnId(), tZoneOptional.get().getTunnelType()); InstanceIdentifier<InternalTunnel> intIID = InstanceIdentifier.builder(TunnelList.class).
flag = true; String strTunnelType ; if( (tZ.getTunnelType()).equals(TunnelTypeGre.class) ) strTunnelType = ITMConstants.TUNNEL_TYPE_GRE ; else
TransportZone tzoneFromDs = tZoneOptional.get(); LOG.debug("read tzone container" + tzoneFromDs.toString()); if (tzoneFromDs.getTunnelType() == null || (tzoneFromDs.getTunnelType()).equals(TunnelTypeVxlan.class)) { tZone = new TransportZoneBuilder().setKey(new TransportZoneKey(tZ)) .setTunnelType(TunnelTypeVxlan.class).setSubnets(subnetList) .setZoneName(tZ).build(); } else if ((tzoneFromDs.getTunnelType()).equals(TunnelTypeGre.class)) { tZone = new TransportZoneBuilder().setKey(new TransportZoneKey(tZ))
HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
child(TransportZone.class, new TransportZoneKey(tzone)).build(); Optional<TransportZone> tZoneOptional = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker); Class<? extends TunnelTypeBase> tunType = tZoneOptional.get().getTunnelType(); if (tZoneOptional.isPresent()) { if (tZoneOptional.get().getSubnets() != null && !tZoneOptional.get().getSubnets().isEmpty()) {
HwVtep hwVtep = ItmUtils.createHwVtepObject(deviceVtep.getTopologyId(), deviceVtep.getNodeId(), deviceVtep.getIpAddress(), sub.getPrefix(), sub.getGatewayIp(), sub.getVlanId(), tzone.getTunnelType(), tzone); hwVteps.add(hwVtep);
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()); 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());
if (!(tzone.getTunnelType().equals(TunnelTypeVxlan.class))) continue; foundVxlanTzone = true;
if (!(tzone.getTunnelType().equals(TunnelTypeVxlan.class))) continue; foundVxlanTzone = true;
hwVtepDS.getTopologyId(), hwVtepDS.getNodeId(), hwVtepDS.getIpAddress(), tZone.getTunnelType(), t, futures); deleteTrunksTORTOR(dataBroker, idManagerService, hwTep.getTopo_id(), hwTep.getNode_id(), hwTep.getHwIp(), hwVtepDS.getTopologyId(), hwVtepDS.getNodeId(), hwVtepDS.getIpAddress(), originalTZone.getTunnelType(), t, futures); deleteTrunksCSSTOR(dataBroker, idManagerService, vtep.getDpnId(), parentIf, vtep.getIpAddress(), hwTep.getTopo_id(), hwTep.getNode_id(), hwTep.getHwIp(), originalTZone.getTunnelType(), t, futures);