java.lang.Object
io.helidon.webserver.grpc.GrpcRouting.Builder
- All Implemented Interfaces:
Builder<GrpcRouting.Builder,
,GrpcRouting> Supplier<GrpcRouting>
- Enclosing class:
GrpcRouting
public static class GrpcRouting.Builder
extends Object
implements Builder<GrpcRouting.Builder,GrpcRouting>
Fluent API builder for
GrpcRouting
.-
Method Summary
Modifier and TypeMethodDescription<ReqT,
ResT>
GrpcRouting.Builderbidi
(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Bidirectional route.build()
Build the instance from this builder.<ReqT,
ResT>
GrpcRouting.BuilderclientStream
(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Client streaming route.intercept
(int weight, io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.intercept
(io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.<ReqT,
ResT>
GrpcRouting.BuilderserverStream
(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Server streaming route.service
(com.google.protobuf.Descriptors.FileDescriptor proto, io.grpc.BindableService service) Add all the routes for aBindableService
service.service
(io.grpc.BindableService service) Configure a bindable service.service
(io.grpc.ServerServiceDefinition service) Add all the routes for theServerServiceDefinition
service.service
(GrpcService service) Configure grpc service.service
(GrpcServiceDescriptor service) Configure a service using aServiceDescriptor
.<ReqT,
ResT>
GrpcRouting.Builderunary
(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method) Unary route.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<GrpcRouting.Builder,
GrpcRouting> - Returns:
- instance of the built type
-
service
Configure grpc service.- Parameters:
service
- service to add- Returns:
- updated builder
-
service
Configure a bindable service.- Parameters:
service
- service to add- Returns:
- updated builder
-
service
Configure a service using aServiceDescriptor
.- Parameters:
service
- service to add- Returns:
- updated builder
-
intercept
Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.If the added interceptors are annotated with the
Weight
or if they implemented theWeighted
interface, that value will be used to assign a weight to use when applying the interceptor otherwise a weight ofInterceptorWeights.USER
will be used.- Parameters:
interceptors
- one or more globalServerInterceptor
s- Returns:
- this builder to allow fluent method chaining
-
intercept
Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.The added interceptors will be applied using the specified weight.
- Parameters:
weight
- the weight to assign to the interceptorsinterceptors
- one or more globalServerInterceptor
s- Returns:
- this builder to allow fluent method chaining
-
unary
public <ReqT,ResT> GrpcRouting.Builder unary(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method) Unary route.- Type Parameters:
ReqT
- request typeResT
- response type- Parameters:
proto
- proto descriptorserviceName
- service namemethodName
- method namemethod
- method to handle this route- Returns:
- updated builder
-
bidi
public <ReqT,ResT> GrpcRouting.Builder bidi(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Bidirectional route.- Type Parameters:
ReqT
- request typeResT
- response type- Parameters:
proto
- proto descriptorserviceName
- service namemethodName
- method namemethod
- method to handle this route- Returns:
- updated builder
-
serverStream
public <ReqT,ResT> GrpcRouting.Builder serverStream(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Server streaming route.- Type Parameters:
ReqT
- request typeResT
- response type- Parameters:
proto
- proto descriptorserviceName
- service namemethodName
- method namemethod
- method to handle this route- Returns:
- updated builder
-
clientStream
public <ReqT,ResT> GrpcRouting.Builder clientStream(com.google.protobuf.Descriptors.FileDescriptor proto, String serviceName, String methodName, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Client streaming route.- Type Parameters:
ReqT
- request typeResT
- response type- Parameters:
proto
- proto descriptorserviceName
- service namemethodName
- method namemethod
- method to handle this route- Returns:
- updated builder
-
service
public GrpcRouting.Builder service(com.google.protobuf.Descriptors.FileDescriptor proto, io.grpc.BindableService service) Add all the routes for aBindableService
service.- Parameters:
proto
- the proto descriptorservice
- theBindableService
to add routes for- Returns:
- updated builder
-
service
Add all the routes for theServerServiceDefinition
service.- Parameters:
service
- theServerServiceDefinition
to add routes for- Returns:
- updated builder
-