Class NettyGrpcServerFactory
java.lang.Object
net.devh.boot.grpc.server.serverfactory.AbstractGrpcServerFactory<NettyServerBuilder>
net.devh.boot.grpc.server.serverfactory.NettyGrpcServerFactory
- All Implemented Interfaces:
GrpcServerFactory
Factory for netty based grpc servers.
-
Field Summary
Fields inherited from class net.devh.boot.grpc.server.serverfactory.AbstractGrpcServerFactory
properties, serverConfigurers -
Constructor Summary
ConstructorsConstructorDescriptionNettyGrpcServerFactory(GrpcServerProperties properties, List<GrpcServerConfigurer> serverConfigurers) Creates a new netty server factory with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidconfigureAcceptedClientCertificates(GrpcServerProperties.Security security, io.netty.handler.ssl.SslContextBuilder sslContextBuilder) Configures the client certificates accepted by the ssl context.protected voidConfigures the keep alive options that should be used by the server.protected voidconfigureKeepAlive(NettyServerBuilder builder) Configures the keep alive options that should be used by the server.protected voidconfigureSecurity(NettyServerBuilder builder) Configures the security options that should be used by the server.protected NettyServerBuilderCreates a new server builder.protected static io.netty.handler.ssl.SslContextBuilderCreates a new server ssl context builder.protected static 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
-
NettyGrpcServerFactory
public NettyGrpcServerFactory(GrpcServerProperties properties, List<GrpcServerConfigurer> serverConfigurers) Creates a new 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
Description copied from class:AbstractGrpcServerFactoryCreates a new server builder.- Specified by:
newServerBuilderin classAbstractGrpcServerFactory<NettyServerBuilder>- Returns:
- The newly created server builder.
-
configureConnectionLimits
Description copied from class:AbstractGrpcServerFactoryConfigures the keep alive options that should be used by the server.- Overrides:
configureConnectionLimitsin classAbstractGrpcServerFactory<NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
configureKeepAlive
Description copied from class:AbstractGrpcServerFactoryConfigures the keep alive options that should be used by the server.- Overrides:
configureKeepAlivein classAbstractGrpcServerFactory<NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
configureSecurity
Description copied from class:AbstractGrpcServerFactoryConfigures the security options that should be used by the server.- Overrides:
configureSecurityin classAbstractGrpcServerFactory<NettyServerBuilder>- Parameters:
builder- The server builder to configure.
-
newServerSslContextBuilder
protected static 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.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.
-