Module io.helidon.webserver.grpc
Package io.helidon.webserver.grpc
Class GrpcServiceDescriptor.Builder
java.lang.Object
io.helidon.webserver.grpc.GrpcServiceDescriptor.Builder
- All Implemented Interfaces:
Builder<GrpcServiceDescriptor.Builder,
,GrpcServiceDescriptor> GrpcServiceDescriptor.Rules
,Supplier<GrpcServiceDescriptor>
- Enclosing class:
GrpcServiceDescriptor
public static final class GrpcServiceDescriptor.Builder
extends Object
implements GrpcServiceDescriptor.Rules, Builder<GrpcServiceDescriptor.Builder,GrpcServiceDescriptor>
A
GrpcServiceDescriptor
builder.-
Method Summary
Modifier and TypeMethodDescriptionaddContextValue
(io.grpc.Context.Key<V> key, V value) Add value to theContext
for the service.<ReqT,
ResT>
GrpcServiceDescriptor.Builderbidirectional
(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Register bi-directional streaming method for the service.<ReqT,
ResT>
GrpcServiceDescriptor.Builderbidirectional
(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register bi-directional streaming method for the service.build()
Build the instance from this builder.<ReqT,
ResT>
GrpcServiceDescriptor.BuilderclientStreaming
(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Register client streaming method for the service.<ReqT,
ResT>
GrpcServiceDescriptor.BuilderclientStreaming
(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 moreServerInterceptor
instances that will intercept calls to this service.intercept
(io.grpc.ServerInterceptor... interceptors) Add one or moreServerInterceptor
instances that will intercept calls to this service.Register one or moreinterceptors
for a named method of the service.Register one or moreinterceptors
for a named method of the service.marshallerSupplier
(MarshallerSupplier marshallerSupplier) Register theMarshallerSupplier
for 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.BuilderserverStreaming
(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Register server streaming method for the service.<ReqT,
ResT>
GrpcServiceDescriptor.BuilderserverStreaming
(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register server streaming method for the service.toString()
<ReqT,
ResT>
GrpcServiceDescriptor.BuilderRegister unary method for the service.<ReqT,
ResT>
GrpcServiceDescriptor.Builderunary
(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Register unary method for the service.
-
Method Details
-
name
Description copied from interface:GrpcServiceDescriptor.Rules
Obtain the name fo the service this configuration configures.- Specified by:
name
in interfaceGrpcServiceDescriptor.Rules
- Returns:
- the name fo the service this configuration configures
-
name
Description copied from interface:GrpcServiceDescriptor.Rules
Set the name for the service.- Specified by:
name
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
name
- the service name- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
proto
Description copied from interface:GrpcServiceDescriptor.Rules
Register the proto for the service.- Specified by:
proto
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
proto
- the service proto- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
marshallerSupplier
Description copied from interface:GrpcServiceDescriptor.Rules
Register theMarshallerSupplier
for the service.- Specified by:
marshallerSupplier
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
marshallerSupplier
- theMarshallerSupplier
for the service- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
unary
public <ReqT,ResT> GrpcServiceDescriptor.Builder unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method) Description copied from interface:GrpcServiceDescriptor.Rules
Register unary method for the service.- Specified by:
unary
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
unary
public <ReqT,ResT> GrpcServiceDescriptor.Builder unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:GrpcServiceDescriptor.Rules
Register unary method for the service.- Specified by:
unary
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
serverStreaming
public <ReqT,ResT> GrpcServiceDescriptor.Builder serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Description copied from interface:GrpcServiceDescriptor.Rules
Register server streaming method for the service.- Specified by:
serverStreaming
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
serverStreaming
public <ReqT,ResT> GrpcServiceDescriptor.Builder serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:GrpcServiceDescriptor.Rules
Register server streaming method for the service.- Specified by:
serverStreaming
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
clientStreaming
public <ReqT,ResT> GrpcServiceDescriptor.Builder clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Description copied from interface:GrpcServiceDescriptor.Rules
Register client streaming method for the service.- Specified by:
clientStreaming
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
clientStreaming
public <ReqT,ResT> GrpcServiceDescriptor.Builder clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:GrpcServiceDescriptor.Rules
Register client streaming method for the service.- Specified by:
clientStreaming
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
bidirectional
public <ReqT,ResT> GrpcServiceDescriptor.Builder bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Description copied from interface:GrpcServiceDescriptor.Rules
Register bi-directional streaming method for the service.- Specified by:
bidirectional
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
bidirectional
public <ReqT,ResT> GrpcServiceDescriptor.Builder bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, GrpcMethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:GrpcServiceDescriptor.Rules
Register bi-directional streaming method for the service.- Specified by:
bidirectional
in interfaceGrpcServiceDescriptor.Rules
- 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.Rules
instance for fluent call chaining
-
intercept
Description copied from interface:GrpcServiceDescriptor.Rules
Add one or moreServerInterceptor
instances that will intercept calls to this service.If the added interceptors are annotated with the
Weight
annotation then that value will be used to assign a weight to use when applying the interceptor otherwise a priority ofInterceptorWeights.USER
will be used.- Specified by:
intercept
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
interceptors
- one or moreServerInterceptor
s to add- Returns:
- this builder to allow fluent method chaining
-
intercept
public GrpcServiceDescriptor.Builder intercept(int priority, io.grpc.ServerInterceptor... interceptors) Description copied from interface:GrpcServiceDescriptor.Rules
Add one or moreServerInterceptor
instances that will intercept calls to this service.The added interceptors will be applied using the specified priority.
- Specified by:
intercept
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
priority
- the priority to assign to the interceptorsinterceptors
- one or moreServerInterceptor
s to add- Returns:
- this builder to allow fluent method chaining
-
intercept
public GrpcServiceDescriptor.Builder intercept(String methodName, io.grpc.ServerInterceptor... interceptors) Description copied from interface:GrpcServiceDescriptor.Rules
Register one or moreinterceptors
for a named method of the service.If the added interceptors are annotated with the
Weight
annotation then that value will be used to assign a weight to use when applying the interceptor otherwise a priority ofInterceptorWeights.USER
will be used.- Specified by:
intercept
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
methodName
- the name of the method to interceptinterceptors
- the interceptor(s) to register- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
intercept
public GrpcServiceDescriptor.Builder intercept(String methodName, int priority, io.grpc.ServerInterceptor... interceptors) Description copied from interface:GrpcServiceDescriptor.Rules
Register one or moreinterceptors
for a named method of the service.The added interceptors will be applied using the specified priority.
- Specified by:
intercept
in interfaceGrpcServiceDescriptor.Rules
- Parameters:
methodName
- the name of the method to interceptpriority
- the priority to assign to the interceptorsinterceptors
- the interceptor(s) to register- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
addContextValue
Description copied from interface:GrpcServiceDescriptor.Rules
Add value to theContext
for the service.- Specified by:
addContextValue
in interfaceGrpcServiceDescriptor.Rules
- Type Parameters:
V
- the type of the value- Parameters:
key
- the key for the context valuevalue
- the value to add- Returns:
- this
GrpcServiceDescriptor.Rules
instance for fluent call chaining
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<GrpcServiceDescriptor.Builder,
GrpcServiceDescriptor> - Returns:
- instance of the built type
-
toString
-