use of io.grpc.xds.EnvoyServerProtoData.Listener in project grpc-java by grpc.
the class XdsServerTestHelper method generateListenerUpdate.
static void generateListenerUpdate(FakeXdsClient xdsClient, ImmutableList<Integer> sourcePorts, EnvoyServerProtoData.DownstreamTlsContext tlsContext, EnvoyServerProtoData.DownstreamTlsContext tlsContextForDefaultFilterChain, TlsContextManager tlsContextManager) {
EnvoyServerProtoData.Listener listener = buildTestListener("listener1", "10.1.2.3", sourcePorts, tlsContext, tlsContextForDefaultFilterChain, tlsContextManager);
LdsUpdate listenerUpdate = LdsUpdate.forTcpListener(listener);
xdsClient.deliverLdsUpdate(listenerUpdate);
}
use of io.grpc.xds.EnvoyServerProtoData.Listener in project grpc-java by grpc.
the class XdsServerTestHelper method generateListenerUpdate.
static void generateListenerUpdate(FakeXdsClient xdsClient, EnvoyServerProtoData.DownstreamTlsContext tlsContext, TlsContextManager tlsContextManager) {
EnvoyServerProtoData.Listener listener = buildTestListener("listener1", "10.1.2.3", ImmutableList.of(), tlsContext, null, tlsContextManager);
LdsUpdate listenerUpdate = LdsUpdate.forTcpListener(listener);
xdsClient.deliverLdsUpdate(listenerUpdate);
}
use of io.grpc.xds.EnvoyServerProtoData.Listener in project grpc-java by grpc.
the class XdsServerTestHelper method buildTestListener.
static EnvoyServerProtoData.Listener buildTestListener(String name, String address, ImmutableList<Integer> sourcePorts, EnvoyServerProtoData.DownstreamTlsContext tlsContext, EnvoyServerProtoData.DownstreamTlsContext tlsContextForDefaultFilterChain, TlsContextManager tlsContextManager) {
EnvoyServerProtoData.FilterChainMatch filterChainMatch1 = EnvoyServerProtoData.FilterChainMatch.create(0, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), ConnectionSourceType.ANY, sourcePorts, ImmutableList.of(), "");
EnvoyServerProtoData.FilterChainMatch defaultFilterChainMatch = EnvoyServerProtoData.FilterChainMatch.create(0, ImmutableList.of(), ImmutableList.of(), ImmutableList.of(), ConnectionSourceType.ANY, ImmutableList.of(), ImmutableList.of(), "");
VirtualHost virtualHost = VirtualHost.create("virtual-host", Collections.singletonList("auth"), new ArrayList<Route>(), ImmutableMap.<String, FilterConfig>of());
HttpConnectionManager httpConnectionManager = HttpConnectionManager.forVirtualHosts(0L, Collections.singletonList(virtualHost), new ArrayList<NamedFilterConfig>());
EnvoyServerProtoData.FilterChain filterChain1 = EnvoyServerProtoData.FilterChain.create("filter-chain-foo", filterChainMatch1, httpConnectionManager, tlsContext, tlsContextManager);
EnvoyServerProtoData.FilterChain defaultFilterChain = EnvoyServerProtoData.FilterChain.create("filter-chain-bar", defaultFilterChainMatch, httpConnectionManager, tlsContextForDefaultFilterChain, tlsContextManager);
EnvoyServerProtoData.Listener listener = EnvoyServerProtoData.Listener.create(name, address, ImmutableList.of(filterChain1), defaultFilterChain);
return listener;
}
Aggregations