Search in sources :

Example 1 with Listener

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);
}
Also used : LdsUpdate(io.grpc.xds.XdsClient.LdsUpdate) Listener(io.grpc.xds.EnvoyServerProtoData.Listener)

Example 2 with Listener

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);
}
Also used : LdsUpdate(io.grpc.xds.XdsClient.LdsUpdate) Listener(io.grpc.xds.EnvoyServerProtoData.Listener)

Example 3 with Listener

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;
}
Also used : NamedFilterConfig(io.grpc.xds.Filter.NamedFilterConfig) FilterChain(io.grpc.xds.EnvoyServerProtoData.FilterChain) Listener(io.grpc.xds.EnvoyServerProtoData.Listener) Route(io.grpc.xds.VirtualHost.Route)

Aggregations

Listener (io.grpc.xds.EnvoyServerProtoData.Listener)3 LdsUpdate (io.grpc.xds.XdsClient.LdsUpdate)2 FilterChain (io.grpc.xds.EnvoyServerProtoData.FilterChain)1 NamedFilterConfig (io.grpc.xds.Filter.NamedFilterConfig)1 Route (io.grpc.xds.VirtualHost.Route)1