Package io.grpc.xds
Class XdsServerBuilder
- java.lang.Object
-
- io.grpc.ServerBuilder<T>
-
- io.grpc.ForwardingServerBuilder<XdsServerBuilder>
-
- io.grpc.xds.XdsServerBuilder
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/7514") public final class XdsServerBuilder extends ForwardingServerBuilder<XdsServerBuilder>
A version ofServerBuilderto create xDS managed servers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceXdsServerBuilder.XdsServingStatusListenerApplications can register this listener to receive "serving" and "not serving" states of the server usingxdsServingStatusListener(XdsServingStatusListener).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Serverbuild()Returns theServerbuilt by the delegate by default.protected ServerBuilder<?>delegate()Returns the delegatedServerBuilder.XdsServerBuilderdrainGraceTime(long drainGraceTime, TimeUnit drainGraceTimeUnit)Sets the grace time when draining connections with outdated configuration.static ServerBuilder<?>forPort(int port)static XdsServerBuilderforPort(int port, ServerCredentials serverCredentials)Creates a gRPC server builder for the given port.XdsServerBuilderoverrideBootstrapForTest(Map<String,?> bootstrapOverride)Allows providing bootstrap override, useful for testing.ServerBuilder<?>transportBuilder()Returns the delegateNettyServerBuilderto allow experimental level transport-specific configuration.XdsServerBuilderxdsServingStatusListener(XdsServerBuilder.XdsServingStatusListener xdsServingStatusListener)Set theXdsServerBuilder.XdsServingStatusListenerto receive "serving" and "not serving" states.-
Methods inherited from class io.grpc.ForwardingServerBuilder
addService, addService, addStreamTracerFactory, addTransportFilter, callExecutor, compressorRegistry, decompressorRegistry, directExecutor, executor, fallbackHandlerRegistry, handshakeTimeout, intercept, keepAliveTime, keepAliveTimeout, maxConnectionAge, maxConnectionAgeGrace, maxConnectionIdle, maxInboundMessageSize, maxInboundMetadataSize, permitKeepAliveTime, permitKeepAliveWithoutCalls, setBinaryLog, toString, useTransportSecurity, useTransportSecurity
-
Methods inherited from class io.grpc.ServerBuilder
addServices
-
-
-
-
Method Detail
-
delegate
@Internal protected ServerBuilder<?> delegate()
Description copied from class:ForwardingServerBuilderReturns the delegatedServerBuilder.- Specified by:
delegatein classForwardingServerBuilder<XdsServerBuilder>
-
xdsServingStatusListener
public XdsServerBuilder xdsServingStatusListener(XdsServerBuilder.XdsServingStatusListener xdsServingStatusListener)
Set theXdsServerBuilder.XdsServingStatusListenerto receive "serving" and "not serving" states.
-
drainGraceTime
public XdsServerBuilder drainGraceTime(long drainGraceTime, TimeUnit drainGraceTimeUnit)
Sets the grace time when draining connections with outdated configuration. When an xDS config update changes connection configuration, pre-existing connections stop accepting new RPCs to be replaced by new connections. RPCs on those pre-existing connections have the grace time to complete. RPCs that do not complete in time will be cancelled, allowing the connection to terminate.Long.MAX_VALUEnano seconds or an unreasonably large value are considered infinite. The default is 10 minutes.
-
forPort
public static ServerBuilder<?> forPort(int port)
-
forPort
public static XdsServerBuilder forPort(int port, ServerCredentials serverCredentials)
Creates a gRPC server builder for the given port.
-
build
public Server build()
Description copied from class:ForwardingServerBuilderReturns theServerbuilt by the delegate by default. Overriding method can return different value.- Overrides:
buildin classForwardingServerBuilder<XdsServerBuilder>- Returns:
- a new Server
-
overrideBootstrapForTest
public XdsServerBuilder overrideBootstrapForTest(Map<String,?> bootstrapOverride)
Allows providing bootstrap override, useful for testing.
-
transportBuilder
public ServerBuilder<?> transportBuilder()
Returns the delegateNettyServerBuilderto allow experimental level transport-specific configuration. Note this API will always be experimental.
-
-