L3Context getL3ContextForSubnet(IndexedTenant indexedTenant, Subnet subnet) { if (indexedTenant == null || subnet == null || subnet.getParent() == null) { return null; } return indexedTenant.resolveL3Context(new L2FloodDomainId(subnet.getParent().getValue())); }
@Override public void onDeleted(Network network, Neutron oldNeutron, Neutron newNeutron) { LOG.trace("deleted network - {}", network); ReadWriteTransaction rwTx = dataProvider.newReadWriteTransaction(); TenantId tenantId = new TenantId(network.getTenantId().getValue()); ContextId id = new ContextId(network.getUuid().getValue()); Optional<ForwardingContext> potentialL2Fd = DataStoreHelper.removeIfExists(LogicalDatastoreType.CONFIGURATION, L2L3IidFactory.l2FloodDomainIid(tenantId, id), rwTx); if (!potentialL2Fd.isPresent()) { LOG.warn("Illegal state - l2-flood-domain {} does not exist.", id.getValue()); return; } Optional<ForwardingContext> potentialL2Bd = DataStoreHelper.removeIfExists(LogicalDatastoreType.CONFIGURATION, L2L3IidFactory.l2BridgeDomainIid(tenantId, id), rwTx); if (!potentialL2Bd.isPresent()) { LOG.warn("Illegal state - l2-bridge-domain {} does not exist.", id.getValue()); return; } Optional<ForwardingContext> potentialL3Ctx = DataStoreHelper.removeIfExists(LogicalDatastoreType.CONFIGURATION, L2L3IidFactory.l3ContextIid(tenantId, id), rwTx); if (!potentialL3Ctx.isPresent()) { LOG.warn("Illegal state - l3-context {} does not exist.", id.getValue()); return; } removeTenantNetworkDomains(network, tenantId, rwTx); DataStoreHelper.submitToDs(rwTx); }
if (L2FloodDomain.class.equals(fwCtxCont.getContextType())) { return fwCtxCont.getContextId() == null ? java.util.Optional.empty() : java.util.Optional .of(fwCtxCont.getContextId().getValue());
L2FloodDomainId consL2FldId = new L2FloodDomainId(consSubnet.getParent().getValue()); L2FloodDomain consFloodDomain = readL2FloodDomain(consL2FldId, tenantId); if (consFloodDomain == null) { return null; L2FloodDomainId provL2FldId = new L2FloodDomainId(provSubnet.getParent().getValue()); L2FloodDomain provFloodDomain = readL2FloodDomain(provL2FldId, tenantId); if (provFloodDomain == null) {
addProviderPhysicalNetworkMapping(tenantId, new L2FloodDomainId(ctxId.getValue()), NetworkUtils.getSegmentationId(network), rwTx);
if (natIpSubnet != null && natIpSubnet.getParent() != null) { L2FloodDomain natEpl2Fd = ctx.getTenant(natL3Ep.getTenant()).resolveL2FloodDomain(new L2FloodDomainId(natIpSubnet.getParent().getValue())); if (natEpl2Fd != null && natEpl2Fd.getAugmentation(Segmentation.class) != null) { Integer vlanId = natEpl2Fd.getAugmentation(Segmentation.class).getSegmentationId(); L2FloodDomain l2Fd = ctx.getTenant(endpoint.getTenant()).resolveL2FloodDomain(new L2FloodDomainId(sub.getParent().getValue())); if (l2Fd == null) { return;
Subnet subnet = ctx.getTenant(extEp.getTenant()).resolveSubnet(new SubnetId(extEp.getNetworkContainment())); L2FloodDomain l2Fd = ctx.getTenant(extEp.getTenant()) .resolveL2FloodDomain(new L2FloodDomainId(subnet.getParent().getValue())); if (l2Fd != null) { Segmentation segmentation = l2Fd.getAugmentation(Segmentation.class);
L2FloodDomain l2Fd = null; if (extSubnet != null && extSubnet.getParent() != null) { l2Fd = tenant.resolveL2FloodDomain(new L2FloodDomainId(extSubnet.getParent().getValue()));
L2FloodDomainId l2fdId = new L2FloodDomainId(s.getParent().getValue()); L2BridgeDomain bd = tenant.resolveL2BridgeDomain(l2fdId); L2FloodDomain fd = tenant.resolveL2FloodDomain(l2fdId);