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 globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.intercept(io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt 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 aBindableServiceservice.service(io.grpc.BindableService service) Configure a bindable service.service(io.grpc.ServerServiceDefinition service) Add all the routes for theServerServiceDefinitionservice.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:BuilderBuild the instance from this builder.- Specified by:
buildin 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
public GrpcRouting.Builder service(com.google.protobuf.Descriptors.FileDescriptor proto, io.grpc.BindableService service) Add all the routes for aBindableServiceservice.- Parameters:
proto- the proto descriptorservice- theBindableServiceto add routes for- Returns:
- updated builder
-
service
Configure a service using aServiceDescriptor.- Parameters:
service- service to add- Returns:
- updated builder
-
service
Add all the routes for theServerServiceDefinitionservice.- Parameters:
service- theServerServiceDefinitionto add routes for- Returns:
- updated builder
-
intercept
Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.If the added interceptors are annotated with the
Weightor if they implemented theWeightedinterface, that value will be used to assign a weight to use when applying the interceptor otherwise a weight ofInterceptorWeights.USERwill be used.- Parameters:
interceptors- one or more globalServerInterceptors- Returns:
- this builder to allow fluent method chaining
-
intercept
Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt 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 globalServerInterceptors- 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
-