@Test public void getL2EpOfSubnetGateway_nullCase() { Endpoint result = utils.getL2EpOfSubnetGateway(buildTenant().getId(), null); assertNull(result); }
Endpoint getL2EpOfSubnetGateway(TenantId tenantId, Subnet subnet) { if (subnet != null && subnet.getVirtualRouterIp() != null) { IpAddress gwIpAddress = subnet.getVirtualRouterIp(); Collection<EndpointL3Prefix> prefixEps = ctx.getEndpointManager().getEndpointsL3PrefixForTenant(tenantId); if (prefixEps != null) { for (EndpointL3Prefix prefixEp : prefixEps) { for (EndpointL3Gateways gw : prefixEp.getEndpointL3Gateways()) { EndpointL3 l3Ep = ctx.getEndpointManager().getL3Endpoint(gw.getL3Context(), gwIpAddress, prefixEp.getTenant()); if (l3Ep != null && l3Ep.getL2Context() != null && l3Ep.getMacAddress() != null) { return ctx.getEndpointManager().getEndpoint( new EpKey(l3Ep.getL2Context(), l3Ep.getMacAddress())); } } } } } return null; }
DestinationMapperUtils { Endpoint getL2EpOfSubnetGateway(TenantId tenantId, Subnet subnet) { if (subnet != null && subnet.getVirtualRouterIp() != null) { IpAddress gwIpAddress = subnet.getVirtualRouterIp(); Collection<EndpointL3Prefix> prefixEps = ctx.getEndpointManager().getEndpointsL3PrefixForTenant(tenantId); if (prefixEps != null) { for (EndpointL3Prefix prefixEp : prefixEps) { for (EndpointL3Gateways gw : prefixEp.getEndpointL3Gateways()) { EndpointL3 l3Ep = ctx.getEndpointManager().getL3Endpoint(gw.getL3Context(), gwIpAddress, prefixEp.getTenant()); if (l3Ep != null && l3Ep.getL2Context() != null && l3Ep.getMacAddress() != null) { return ctx.getEndpointManager().getEndpoint( new EpKey(l3Ep.getL2Context(), l3Ep.getMacAddress())); } } } } } return null; } }
DestinationMapperUtils { Endpoint getL2EpOfSubnetGateway(TenantId tenantId, Subnet subnet) { if (subnet != null && subnet.getVirtualRouterIp() != null) { IpAddress gwIpAddress = subnet.getVirtualRouterIp(); Collection<EndpointL3Prefix> prefixEps = ctx.getEndpointManager().getEndpointsL3PrefixForTenant(tenantId); if (prefixEps != null) { for (EndpointL3Prefix prefixEp : prefixEps) { for (EndpointL3Gateways gw : prefixEp.getEndpointL3Gateways()) { EndpointL3 l3Ep = ctx.getEndpointManager().getL3Endpoint(gw.getL3Context(), gwIpAddress, prefixEp.getTenant()); if (l3Ep != null && l3Ep.getL2Context() != null && l3Ep.getMacAddress() != null) { return ctx.getEndpointManager().getEndpoint( new EpKey(l3Ep.getL2Context(), l3Ep.getMacAddress())); } } } } } return null; } DestinationMapperUtils(OfContext ctx); }
DestinationMapperUtils { Endpoint getL2EpOfSubnetGateway(TenantId tenantId, Subnet subnet) { if (subnet != null && subnet.getVirtualRouterIp() != null) { IpAddress gwIpAddress = subnet.getVirtualRouterIp(); Collection<EndpointL3Prefix> prefixEps = ctx.getEndpointManager().getEndpointsL3PrefixForTenant(tenantId); if (prefixEps != null) { for (EndpointL3Prefix prefixEp : prefixEps) { for (EndpointL3Gateways gw : prefixEp.getEndpointL3Gateways()) { EndpointL3 l3Ep = ctx.getEndpointManager().getL3Endpoint(gw.getL3Context(), gwIpAddress, prefixEp.getTenant()); if (l3Ep != null && l3Ep.getL2Context() != null && l3Ep.getMacAddress() != null) { return ctx.getEndpointManager().getEndpoint( new EpKey(l3Ep.getL2Context(), l3Ep.getMacAddress())); } } } } } return null; } DestinationMapperUtils(OfContext ctx);  }
DestinationMapperUtils { Endpoint getL2EpOfSubnetGateway(TenantId tenantId, Subnet subnet) { if (subnet != null && subnet.getVirtualRouterIp() != null) { IpAddress gwIpAddress = subnet.getVirtualRouterIp(); Collection<EndpointL3Prefix> prefixEps = ctx.getEndpointManager().getEndpointsL3PrefixForTenant(tenantId); if (prefixEps != null) { for (EndpointL3Prefix prefixEp : prefixEps) { for (EndpointL3Gateways gw : prefixEp.getEndpointL3Gateways()) { EndpointL3 l3Ep = ctx.getEndpointManager().getL3Endpoint(gw.getL3Context(), gwIpAddress, prefixEp.getTenant()); if (l3Ep != null && l3Ep.getL2Context() != null && l3Ep.getMacAddress() != null) { return ctx.getEndpointManager().getEndpoint( new EpKey(l3Ep.getL2Context(), l3Ep.getMacAddress())); } } } } } return null; } DestinationMapperUtils(OfContext ctx);   }