@Test public void createProtocolNegotiatorByType_tlsWithNoContext() { thrown.expect(NullPointerException.class); NettyChannelBuilder.createProtocolNegotiatorByType( NegotiationType.TLS, noSslContext); }
@VisibleForTesting @CheckReturnValue static ProtocolNegotiator createProtocolNegotiatorByType( NegotiationType negotiationType, SslContext sslContext) { switch (negotiationType) { case PLAINTEXT: return ProtocolNegotiators.plaintext(); case PLAINTEXT_UPGRADE: return ProtocolNegotiators.plaintextUpgrade(); case TLS: return ProtocolNegotiators.tls(sslContext); default: throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType); } }
NettyChannelBuilder extends AbstractManagedChannelImplBuilder<NettyChannelBuilder> { @VisibleForTesting @CheckReturnValue static ProtocolNegotiator createProtocolNegotiatorByType( NegotiationType negotiationType, SslContext sslContext) { switch (negotiationType) { case PLAINTEXT: return ProtocolNegotiators.plaintext(); case PLAINTEXT_UPGRADE: return ProtocolNegotiators.plaintextUpgrade(); case TLS: return ProtocolNegotiators.tls(sslContext); default: throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType); } } }
NettyChannelBuilder extends AbstractManagedChannelImplBuilder<NettyChannelBuilder> { @VisibleForTesting @CheckReturnValue static ProtocolNegotiator createProtocolNegotiatorByType( NegotiationType negotiationType, SslContext sslContext) { switch (negotiationType) { case PLAINTEXT: return ProtocolNegotiators.plaintext(); case PLAINTEXT_UPGRADE: return ProtocolNegotiators.plaintextUpgrade(); case TLS: return ProtocolNegotiators.tls(sslContext); default: throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType); } } @CheckReturnValue  NettyChannelBuilder(String host, int port); @CheckReturnValue  NettyChannelBuilder(String target); @CheckReturnValue  NettyChannelBuilder(SocketAddress address); }
NettyChannelBuilder extends AbstractManagedChannelImplBuilder<NettyChannelBuilder> { @VisibleForTesting @CheckReturnValue static ProtocolNegotiator createProtocolNegotiatorByType( NegotiationType negotiationType, SslContext sslContext) { switch (negotiationType) { case PLAINTEXT: return ProtocolNegotiators.plaintext(); case PLAINTEXT_UPGRADE: return ProtocolNegotiators.plaintextUpgrade(); case TLS: return ProtocolNegotiators.tls(sslContext); default: throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType); } } @CheckReturnValue  NettyChannelBuilder(String host, int port); @CheckReturnValue  NettyChannelBuilder(String target); @CheckReturnValue  NettyChannelBuilder(SocketAddress address); @CheckReturnValue static NettyChannelBuilder forAddress(SocketAddress serverAddress); @CheckReturnValue static NettyChannelBuilder forAddress(String host, int port); @CheckReturnValue static NettyChannelBuilder forTarget(String target); NettyChannelBuilder channelType(Class<? extends Channel> channelType); NettyChannelBuilder withOption(ChannelOption<T> option, T value); NettyChannelBuilder negotiationType(NegotiationType type); NettyChannelBuilder eventLoopGroup(@Nullable EventLoopGroup eventLoopGroup); NettyChannelBuilder sslContext(SslContext sslContext); NettyChannelBuilder flowControlWindow(int flowControlWindow); @Deprecated NettyChannelBuilder maxHeaderListSize(int maxHeaderListSize); @Override NettyChannelBuilder maxInboundMetadataSize(int bytes); @Override @Deprecated NettyChannelBuilder usePlaintext(boolean skipNegotiation); @Override NettyChannelBuilder usePlaintext(); @Override NettyChannelBuilder useTransportSecurity(); @Deprecated final NettyChannelBuilder enableKeepAlive(boolean enable); @Deprecated final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
      TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit); @Override NettyChannelBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit); @Override NettyChannelBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit); @Override NettyChannelBuilder keepAliveWithoutCalls(boolean enable); NettyChannelBuilder localSocketPicker(@Nullable LocalSocketPicker localSocketPicker); }
NettyChannelBuilder extends AbstractManagedChannelImplBuilder<NettyChannelBuilder> { @VisibleForTesting @CheckReturnValue static ProtocolNegotiator createProtocolNegotiatorByType( NegotiationType negotiationType, SslContext sslContext) { switch (negotiationType) { case PLAINTEXT: return ProtocolNegotiators.plaintext(); case PLAINTEXT_UPGRADE: return ProtocolNegotiators.plaintextUpgrade(); case TLS: return ProtocolNegotiators.tls(sslContext); default: throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType); } } @CheckReturnValue  NettyChannelBuilder(String host, int port); @CheckReturnValue  NettyChannelBuilder(String target); @CheckReturnValue  NettyChannelBuilder(SocketAddress address); @CheckReturnValue static NettyChannelBuilder forAddress(SocketAddress serverAddress); @CheckReturnValue static NettyChannelBuilder forAddress(String host, int port); @CheckReturnValue static NettyChannelBuilder forTarget(String target); NettyChannelBuilder channelType(Class<? extends Channel> channelType); NettyChannelBuilder withOption(ChannelOption<T> option, T value); NettyChannelBuilder negotiationType(NegotiationType type); NettyChannelBuilder eventLoopGroup(@Nullable EventLoopGroup eventLoopGroup); NettyChannelBuilder sslContext(SslContext sslContext); NettyChannelBuilder flowControlWindow(int flowControlWindow); @Deprecated NettyChannelBuilder maxHeaderListSize(int maxHeaderListSize); @Override NettyChannelBuilder maxInboundMetadataSize(int bytes); @Override @Deprecated NettyChannelBuilder usePlaintext(boolean skipNegotiation); @Override NettyChannelBuilder usePlaintext(); @Override NettyChannelBuilder useTransportSecurity(); @Deprecated final NettyChannelBuilder enableKeepAlive(boolean enable); @Deprecated final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
      TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit); @Override NettyChannelBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit); @Override NettyChannelBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit); @Override NettyChannelBuilder keepAliveWithoutCalls(boolean enable); NettyChannelBuilder localSocketPicker(@Nullable LocalSocketPicker localSocketPicker); static final int DEFAULT_FLOW_CONTROL_WINDOW; }