Package io.grpc.netty
Class InternalProtocolNegotiators
- java.lang.Object
-
- io.grpc.netty.InternalProtocolNegotiators
-
public final class InternalProtocolNegotiators extends java.lang.Object
Internal accessor forProtocolNegotiators
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternalProtocolNegotiators.ProtocolNegotiationHandler
-
Constructor Summary
Constructors Modifier Constructor Description private
InternalProtocolNegotiators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.channel.ChannelHandler
clientTlsHandler(io.netty.channel.ChannelHandler next, io.netty.handler.ssl.SslContext sslContext, java.lang.String authority, ChannelLogger negotiationLogger)
static io.netty.channel.ChannelHandler
grpcNegotiationHandler(GrpcHttp2ConnectionHandler next)
Internal version ofProtocolNegotiators.GrpcNegotiationHandler
.static InternalProtocolNegotiator.ProtocolNegotiator
plaintext()
Returns aProtocolNegotiator
for plaintext client channel.static InternalProtocolNegotiator.ProtocolNegotiator
serverPlaintext()
Returns aProtocolNegotiator
for plaintext server channel.static InternalProtocolNegotiator.ProtocolNegotiator
serverTls(io.netty.handler.ssl.SslContext sslContext)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, the server TLShandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.static InternalProtocolNegotiator.ProtocolNegotiator
tls(io.netty.handler.ssl.SslContext sslContext)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.static InternalProtocolNegotiator.ProtocolNegotiator
tls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends java.util.concurrent.Executor> executorPool, java.util.Optional<java.lang.Runnable> handshakeCompleteRunnable)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.static io.netty.channel.ChannelHandler
waitUntilActiveHandler(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger)
Internal version ofProtocolNegotiators.WaitUntilActiveHandler
.
-
-
-
Method Detail
-
tls
public static InternalProtocolNegotiator.ProtocolNegotiator tls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends java.util.concurrent.Executor> executorPool, java.util.Optional<java.lang.Runnable> handshakeCompleteRunnable)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.- Parameters:
executorPool
- a dedicatedExecutor
pool for time-consuming TLS tasks
-
tls
public static InternalProtocolNegotiator.ProtocolNegotiator tls(io.netty.handler.ssl.SslContext sslContext)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.
-
serverTls
public static InternalProtocolNegotiator.ProtocolNegotiator serverTls(io.netty.handler.ssl.SslContext sslContext)
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, the server TLShandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.
-
plaintext
public static InternalProtocolNegotiator.ProtocolNegotiator plaintext()
Returns aProtocolNegotiator
for plaintext client channel.
-
serverPlaintext
public static InternalProtocolNegotiator.ProtocolNegotiator serverPlaintext()
Returns aProtocolNegotiator
for plaintext server channel.
-
waitUntilActiveHandler
public static io.netty.channel.ChannelHandler waitUntilActiveHandler(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger)
Internal version ofProtocolNegotiators.WaitUntilActiveHandler
.
-
grpcNegotiationHandler
public static io.netty.channel.ChannelHandler grpcNegotiationHandler(GrpcHttp2ConnectionHandler next)
Internal version ofProtocolNegotiators.GrpcNegotiationHandler
.
-
clientTlsHandler
public static io.netty.channel.ChannelHandler clientTlsHandler(io.netty.channel.ChannelHandler next, io.netty.handler.ssl.SslContext sslContext, java.lang.String authority, ChannelLogger negotiationLogger)
-
-