Module io.helidon.webserver.grpc
Package io.helidon.webserver.grpc
Interface GrpcMethodDescriptor.Rules<ReqT,ResT>
- Type Parameters:
ReqT- request typeResT- response type
- Enclosing class:
GrpcMethodDescriptor<ReqT,ResT>
public static interface GrpcMethodDescriptor.Rules<ReqT,ResT>
Method configuration API.
-
Method Summary
Modifier and TypeMethodDescriptionaddContextValue(io.grpc.Context.Key<T> key, T value) Add aContext.Keyand value to be added to the callContextwhen this method is invoked.intercept(int priority, io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptorsfor the method.intercept(io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptorsfor the method.marshallerSupplier(MarshallerSupplier marshallerSupplier) Register theMarshallerSupplierfor the method.<Rnew> GrpcMethodDescriptor.Rules<Rnew, ResT> requestType(Class<Rnew> requestType) Set the request type.<Rnew> GrpcMethodDescriptor.Rules<ReqT, Rnew> responseType(Class<Rnew> responseType) Set the response type.
-
Method Details
-
addContextValue
Add aContext.Keyand value to be added to the callContextwhen this method is invoked.- Type Parameters:
T- the type of theContext.Keyand value- Parameters:
key- theContext.Keyto addvalue- the value to map to theContext.Key- Returns:
- this
GrpcMethodDescriptor.Rulesinstance for fluent call chaining - Throws:
NullPointerException- if the key parameter is null
-
intercept
Register one or moreinterceptorsfor the method.- Parameters:
interceptors- one or moreServerInterceptors to register- Returns:
- this builder to allow fluent method chaining
-
intercept
GrpcMethodDescriptor.Rules<ReqT,ResT> intercept(int priority, io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptorsfor the method.The added interceptors will be applied using the specified priority.
- Parameters:
priority- the priority to assign to the interceptorsinterceptors- one or moreServerInterceptors to register- Returns:
- this builder to allow fluent method chaining
-
marshallerSupplier
Register theMarshallerSupplierfor the method.If not set the default
MarshallerSupplierfrom the service will be used.- Parameters:
marshallerSupplier- theMarshallerSupplierfor the service- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
requestType
Set the request type.Setting the request type is optional as it is used to obtain the correct marshaller so if the marshaller supplier being used is type agnostic, such as Java serialization then whereas some marshallers such as Protocol Buffers require a type.
- Type Parameters:
Rnew- the type of the request message- Parameters:
requestType- the type of the request message- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-
responseType
Set the response type.Setting the response type is optional as it is used to obtain the correct marshaller so if the marshaller supplier being used is type agnostic, such as Java serialization then whereas some marshallers such as Protocol Buffers require a type.
- Type Parameters:
Rnew- the type of the request message- Parameters:
responseType- the type of the request message- Returns:
- this
GrpcServiceDescriptor.Rulesinstance for fluent call chaining
-