private boolean registerExternalGateway(TenantId tenantId, IpPrefix ipPrefix, ContextId routerl3ContextId, NetworkDomainId networkDomainId) { AddressEndpointRegBuilder addrEpBuilder = new AddressEndpointRegBuilder(); addrEpBuilder.setAddressType(IpPrefixType.class); addrEpBuilder.setAddress(MappingUtils.ipPrefixToStringIpAddress(ipPrefix)); addrEpBuilder.setContextId(routerl3ContextId); addrEpBuilder.setContextType(MappingUtils.L3_CONTEXT); addrEpBuilder.setTenant(tenantId); addrEpBuilder.setNetworkContainment(new NetworkContainmentBuilder().setContainment( new NetworkDomainContainmentBuilder().setNetworkDomainId(networkDomainId).build()).build()); addrEpBuilder.setEndpointGroup(ImmutableList.of(MappingUtils.EPG_EXTERNAL_ID)); addrEpBuilder.setTimestamp(System.currentTimeMillis()); return epRegistrator.registerEndpoint(addrEpBuilder.build()); }
ImmutableList.of(l2BaseEp.build(), l3BaseEp.build()), port, rwTx); registerEndpointAndStoreMapping(epInBuilder.build(), port, rwTx); ImmutableList.of(l2BaseEp.build(), l3BaseEp.build()), port, rwTx); registerEndpointAndStoreMapping(epInBuilder.build(), port, rwTx); DataStoreHelper.submitToDs(rwTx); baseEpRegs.add(l2BaseEp.build()); if (l3BaseEp != null) { baseEpRegs.add(l3BaseEp.build());
.build(); epRegistrator.unregisterEndpoint(addrEpUnreg); epRegistrator.registerEndpoint(l3BaseEp.build());
@Override public ListenableFuture<RpcResult<Void>> processTemplatesAndSxpMasterDB( final EndpointPolicyTemplateBySgt epPolicyTemplate, final EndpointForwardingTemplateBySubnet epForwardingTemplate, final MasterDatabaseBinding masterDBBinding) { LOG.debug("processing ep-templates + sxpMasterDB entry: {} - {}", masterDBBinding.getSecurityGroupTag(), masterDBBinding.getIpPrefix()); // apply sxpMasterDB to policy template final Ipv4Prefix address = new Ipv4Prefix(epForwardingTemplate.getIpPrefix().getIpv4Prefix().getValue()); final NetworkContainment networkContainment = new NetworkContainmentBuilder() .setContainment(new NetworkDomainContainmentBuilder() .setNetworkDomainType(epForwardingTemplate.getNetworkContainment().getNetworkDomainType()) .setNetworkDomainId(epForwardingTemplate.getNetworkContainment().getNetworkDomainId()) .build()) .build(); final RegisterEndpointInput epInput = new RegisterEndpointInputBuilder().setAddressEndpointReg( Collections.singletonList(new AddressEndpointRegBuilder().setAddressType(IpPrefixType.class) .setAddress(address.getValue()) .setContextType(L3Context.class) .setContextId(epForwardingTemplate.getL3Context()) .setNetworkContainment(networkContainment) .setCondition(epPolicyTemplate.getConditions()) .setTenant(epPolicyTemplate.getTenant()) .setEndpointGroup(epPolicyTemplate.getEndpointGroups()) .build())) .build(); epForwardingTemplate.getL3Context(); return chainL3EPServiceIfEpAbsent(epInput); }