public static final class GrpcContainer.Builder extends ConnectionBuilder
GrpcContainer
allows to define a port and services exposed
by the container.Modifier and Type | Method and Description |
---|---|
GrpcContainer.Builder |
addService(io.grpc.BindableService service)
Adds a gRPC service to deploy within the container being built.
|
GrpcContainer |
build() |
int |
getPort()
Deprecated.
please use
ConnectionBuilder.port() . |
com.google.common.collect.ImmutableSet<io.grpc.ServerServiceDefinition> |
getServices()
Deprecated.
please use
GrpcContainer.Builder.services() . |
GrpcContainer.Builder |
removeService(io.grpc.ServerServiceDefinition service)
Removes the previously added
gRPC service.
|
com.google.common.collect.ImmutableSet<io.grpc.ServerServiceDefinition> |
services()
Obtains the services already added to the builder.
|
GrpcContainer.Builder |
setPort(int ignored)
Deprecated.
please use
GrpcContainer.atPort(int) . |
GrpcContainer.Builder |
withServer(GrpcContainer.ConfigureServer action)
Sets an additional configuration action for the gRPC
Server instance,
created for this GrpcContainer to run on top of. |
port, serverName
@Deprecated public GrpcContainer.Builder setPort(int ignored)
GrpcContainer.atPort(int)
.@Deprecated public int getPort()
ConnectionBuilder.port()
.@CanIgnoreReturnValue public GrpcContainer.Builder addService(io.grpc.BindableService service)
Builder
, for call chaining@CanIgnoreReturnValue public GrpcContainer.Builder removeService(io.grpc.ServerServiceDefinition service)
If the service under the given definition was not added previously, this method does nothing.
Builder
, for call chaining@Experimental @CanIgnoreReturnValue public GrpcContainer.Builder withServer(GrpcContainer.ConfigureServer action)
Server
instance,
created for this GrpcContainer
to run on top of. This configuration is applied
right before the server is started.
Allows the direct access to gRPC ServerBuilder
's API.
Please note this API is experimental.
Builder
, for call chainingGrpcContainer.ConfigureServer
@Deprecated public com.google.common.collect.ImmutableSet<io.grpc.ServerServiceDefinition> getServices()
GrpcContainer.Builder.services()
.public com.google.common.collect.ImmutableSet<io.grpc.ServerServiceDefinition> services()
public GrpcContainer build()