Class ShadedNettyGrpcServerFactory
java.lang.Object
net.devh.boot.grpc.server.serverfactory.AbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>
net.devh.boot.grpc.server.serverfactory.ShadedNettyGrpcServerFactory
- All Implemented Interfaces:
GrpcServerFactory
public class ShadedNettyGrpcServerFactory
extends AbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>
Factory for shaded netty based grpc servers.
-
Field Summary
Fields inherited from class net.devh.boot.grpc.server.serverfactory.AbstractGrpcServerFactory
properties, serverConfigurers -
Constructor Summary
ConstructorsConstructorDescriptionShadedNettyGrpcServerFactory(GrpcServerProperties properties, List<GrpcServerConfigurer> serverConfigurers) Creates a new shaded netty server factory with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidconfigureAcceptedClientCertificates(GrpcServerProperties.Security security, io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder sslContextBuilder) Configures the client certificates accepted by the ssl context.protected voidconfigureConnectionLimits(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Configures the keep alive options that should be used by the server.protected voidconfigureKeepAlive(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Configures the keep alive options that should be used by the server.protected voidconfigureSecurity(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Configures the security options that should be used by the server.protected io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilderCreates a new server builder.protected static io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilderCreates a new server ssl context builder.protected static io.grpc.netty.shaded.io.netty.handler.ssl.ClientAuthof(ClientAuth clientAuth) Converts the given client auth option to netty's client auth.Methods inherited from class net.devh.boot.grpc.server.serverfactory.AbstractGrpcServerFactory
addService, configure, configureLimits, configureServices, createServer, getAddress, getPort
-
Constructor Details
-
ShadedNettyGrpcServerFactory
public ShadedNettyGrpcServerFactory(GrpcServerProperties properties, List<GrpcServerConfigurer> serverConfigurers) Creates a new shaded netty server factory with the given properties.- Parameters:
properties- The properties used to configure the server.serverConfigurers- The server configurers to use. Can be empty.
-
-
Method Details
-
newServerBuilder
protected io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder newServerBuilder()Description copied from class:AbstractGrpcServerFactoryCreates a new server builder.- Specified by:
newServerBuilderin classAbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>- Returns:
- The newly created server builder.
-
configureConnectionLimits
protected void configureConnectionLimits(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Description copied from class:AbstractGrpcServerFactoryConfigures the keep alive options that should be used by the server.- Overrides:
configureConnectionLimitsin classAbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
configureKeepAlive
protected void configureKeepAlive(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Description copied from class:AbstractGrpcServerFactoryConfigures the keep alive options that should be used by the server.- Overrides:
configureKeepAlivein classAbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
configureSecurity
protected void configureSecurity(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder builder) Description copied from class:AbstractGrpcServerFactoryConfigures the security options that should be used by the server.- Overrides:
configureSecurityin classAbstractGrpcServerFactory<io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
newServerSslContextBuilder
protected static io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder newServerSslContextBuilder(GrpcServerProperties.Security security) Creates a new server ssl context builder.- Parameters:
security- The security configuration to use.- Returns:
- The newly created SslContextBuilder.
-
configureAcceptedClientCertificates
protected static void configureAcceptedClientCertificates(GrpcServerProperties.Security security, io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder sslContextBuilder) Configures the client certificates accepted by the ssl context.- Parameters:
security- The security configuration to use.sslContextBuilder- The ssl context builder to configure.
-
of
Converts the given client auth option to netty's client auth.- Parameters:
clientAuth- The client auth option to convert.- Returns:
- The converted client auth option.
-