Module io.helidon.webserver.grpc
Package io.helidon.webserver.grpc
Interface GrpcServiceDescriptor.Rules
- All Known Implementing Classes:
GrpcServiceDescriptor.Builder
- Enclosing class:
GrpcServiceDescriptor
public static interface GrpcServiceDescriptor.Rules
Fluent configuration interface for the
GrpcServiceDescriptor.-
Method Summary
Modifier and TypeMethodDescriptionaddContextValue(io.grpc.Context.Key<V> key, V value) Add value to theContextfor the service.<ReqT,ResT>
GrpcServiceDescriptor.Rulesbidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Register bi-directional streaming method for the service.<ReqT,ResT>
GrpcServiceDescriptor.Rulesbidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register bi-directional streaming method for the service.<ReqT,ResT>
GrpcServiceDescriptor.RulesclientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Register client streaming method for the service.<ReqT,ResT>
GrpcServiceDescriptor.RulesclientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register client streaming method for the service.intercept(int priority, io.grpc.ServerInterceptor... interceptors) Add one or moreServerInterceptorinstances that will intercept calls to this service.intercept(io.grpc.ServerInterceptor... interceptors) Add one or moreServerInterceptorinstances that will intercept calls to this service.Register one or moreinterceptorsfor a named method of the service.Register one or moreinterceptorsfor a named method of the service.marshallerSupplier(MarshallerSupplier marshallerSupplier) Register theMarshallerSupplierfor the service.name()Obtain the name fo the service this configuration configures.Set the name for the service.proto(com.google.protobuf.Descriptors.FileDescriptor proto) Register the proto for the service.<ReqT,ResT>
GrpcServiceDescriptor.RulesserverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Register server streaming method for the service.<ReqT,ResT>
GrpcServiceDescriptor.RulesserverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register server streaming method for the service.<ReqT,ResT>
GrpcServiceDescriptor.RulesRegister unary method for the service.<ReqT,ResT>
GrpcServiceDescriptor.Rulesunary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register unary method for the service.
-
Method Details
-
name
Set the name for the service.- Parameters:
name- the service name- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining - Throws:
NullPointerException- if the name is nullIllegalArgumentException- if the name is a blank String
-
name
String name()Obtain the name fo the service this configuration configures.- Returns:
- the name fo the service this configuration configures
-
proto
Register the proto for the service.- Parameters:
proto- the service proto- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
marshallerSupplier
Register theMarshallerSupplierfor the service.- Parameters:
marshallerSupplier- theMarshallerSupplierfor the service- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
intercept
Add one or moreServerInterceptorinstances that will intercept calls to this service.If the added interceptors are annotated with the
Weightannotation then that value will be used to assign a weight to use when applying the interceptor otherwise a priority ofInterceptorWeights.USERwill be used.- Parameters:
interceptors- one or moreServerInterceptors to add- Returns:
- this builder to allow fluent method chaining
-
intercept
Add one or moreServerInterceptorinstances that will intercept calls to this service.The added interceptors will be applied using the specified priority.
- Parameters:
priority- the priority to assign to the interceptorsinterceptors- one or moreServerInterceptors to add- Returns:
- this builder to allow fluent method chaining
-
intercept
Register one or moreinterceptorsfor a named method of the service.If the added interceptors are annotated with the
Weightannotation then that value will be used to assign a weight to use when applying the interceptor otherwise a priority ofInterceptorWeights.USERwill be used.- Parameters:
methodName- the name of the method to interceptinterceptors- the interceptor(s) to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining - Throws:
IllegalArgumentException- if no method exists for the specified name
-
intercept
GrpcServiceDescriptor.Rules intercept(String methodName, int priority, io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptorsfor a named method of the service.The added interceptors will be applied using the specified priority.
- Parameters:
methodName- the name of the method to interceptpriority- the priority to assign to the interceptorsinterceptors- the interceptor(s) to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining - Throws:
IllegalArgumentException- if no method exists for the specified name
-
addContextValue
Add value to theContextfor the service.- Type Parameters:
V- the type of the value- Parameters:
key- the key for the context valuevalue- the value to add- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
unary
<ReqT,ResT> GrpcServiceDescriptor.Rules unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method) Register unary method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the unary method to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
unary
<ReqT,ResT> GrpcServiceDescriptor.Rules unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register unary method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the unary method to registerconfigurer- the method configurer- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
serverStreaming
<ReqT,ResT> GrpcServiceDescriptor.Rules serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Register server streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the server streaming method to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
serverStreaming
<ReqT,ResT> GrpcServiceDescriptor.Rules serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register server streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the server streaming method to registerconfigurer- the method configurer- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
clientStreaming
<ReqT,ResT> GrpcServiceDescriptor.Rules clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Register client streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the client streaming method to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
clientStreaming
<ReqT,ResT> GrpcServiceDescriptor.Rules clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register client streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the client streaming method to registerconfigurer- the method configurer- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
bidirectional
<ReqT,ResT> GrpcServiceDescriptor.Rules bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Register bi-directional streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the bi-directional streaming method to register- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
bidirectional
<ReqT,ResT> GrpcServiceDescriptor.Rules bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register bi-directional streaming method for the service.- Type Parameters:
ReqT- the method request typeResT- the method response type- Parameters:
name- the name of the methodmethod- the bi-directional streaming method to registerconfigurer- the method configurer- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-