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 void
configureAcceptedClientCertificates
(GrpcServerProperties.Security security, io.netty.handler.ssl.SslContextBuilder sslContextBuilder) Configures the client certificates accepted by the ssl context.protected void
Configures the keep alive options that should be used by the server.protected void
configureKeepAlive
(NettyServerBuilder builder) Configures the keep alive options that should be used by the server.protected void
configureSecurity
(NettyServerBuilder builder) Configures the security options that should be used by the server.protected NettyServerBuilder
Creates a new server builder.protected static io.netty.handler.ssl.SslContextBuilder
Creates a new server ssl context builder.protected static io.netty.handler.ssl.ClientAuth
of
(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:AbstractGrpcServerFactory
Creates a new server builder.- Specified by:
newServerBuilder
in classAbstractGrpcServerFactory<NettyServerBuilder>
- Returns:
- The newly created server builder.
-
configureConnectionLimits
Description copied from class:AbstractGrpcServerFactory
Configures the keep alive options that should be used by the server.- Overrides:
configureConnectionLimits
in classAbstractGrpcServerFactory<NettyServerBuilder>
- Parameters:
builder
- The server builder to configure.
-
configureKeepAlive
Description copied from class:AbstractGrpcServerFactory
Configures the keep alive options that should be used by the server.- Overrides:
configureKeepAlive
in classAbstractGrpcServerFactory<NettyServerBuilder>
- Parameters:
builder
- The server builder to configure.
-
configureSecurity
Description copied from class:AbstractGrpcServerFactory
Configures the security options that should be used by the server.- Overrides:
configureSecurity
in 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.
-