java.lang.Object
io.helidon.grpc.server.ServiceDescriptor.Builder
- All Implemented Interfaces:
Builder<ServiceDescriptor.Builder,,ServiceDescriptor> ServiceDescriptor.Rules,Supplier<ServiceDescriptor>
- Enclosing class:
- ServiceDescriptor
public static final class ServiceDescriptor.Builder
extends Object
implements ServiceDescriptor.Rules, Builder<ServiceDescriptor.Builder,ServiceDescriptor>
A
ServiceDescriptor builder.-
Method Summary
Modifier and TypeMethodDescriptionaddContextValue(io.grpc.Context.Key<V> key, V value) Add value to theContextfor the service.<ReqT,ResT>
ServiceDescriptor.Builderbidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Register bi-directional streaming method for the service.<ReqT,ResT>
ServiceDescriptor.Builderbidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Register bi-directional streaming method for the service.build()Build the instance from this builder.<ReqT,ResT>
ServiceDescriptor.BuilderclientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Register client streaming method for the service.<ReqT,ResT>
ServiceDescriptor.BuilderclientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Register client streaming method for the service.healthCheck(HealthCheck healthCheck) Register the serviceHealthCheck.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>
ServiceDescriptor.BuilderserverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Register server streaming method for the service.<ReqT,ResT>
ServiceDescriptor.BuilderserverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Register server streaming method for the service.toString()<ReqT,ResT>
ServiceDescriptor.BuilderRegister unary method for the service.<ReqT,ResT>
ServiceDescriptor.Builderunary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Register unary method for the service.
-
Method Details
-
name
Description copied from interface:ServiceDescriptor.RulesObtain the name fo the service this configuration configures.- Specified by:
namein interfaceServiceDescriptor.Rules- Returns:
- the name fo the service this configuration configures
-
name
Description copied from interface:ServiceDescriptor.RulesSet the name for the service.- Specified by:
namein interfaceServiceDescriptor.Rules- Parameters:
name- the service name- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
proto
Description copied from interface:ServiceDescriptor.RulesRegister the proto for the service.- Specified by:
protoin interfaceServiceDescriptor.Rules- Parameters:
proto- the service proto- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
marshallerSupplier
Description copied from interface:ServiceDescriptor.RulesRegister theMarshallerSupplierfor the service.- Specified by:
marshallerSupplierin interfaceServiceDescriptor.Rules- Parameters:
marshallerSupplier- theMarshallerSupplierfor the service- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
unary
public <ReqT,ResT> ServiceDescriptor.Builder unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method) Description copied from interface:ServiceDescriptor.RulesRegister unary method for the service.- Specified by:
unaryin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
unary
public <ReqT,ResT> ServiceDescriptor.Builder unary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:ServiceDescriptor.RulesRegister unary method for the service.- Specified by:
unaryin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
serverStreaming
public <ReqT,ResT> ServiceDescriptor.Builder serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method) Description copied from interface:ServiceDescriptor.RulesRegister server streaming method for the service.- Specified by:
serverStreamingin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
serverStreaming
public <ReqT,ResT> ServiceDescriptor.Builder serverStreaming(String name, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:ServiceDescriptor.RulesRegister server streaming method for the service.- Specified by:
serverStreamingin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
clientStreaming
public <ReqT,ResT> ServiceDescriptor.Builder clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method) Description copied from interface:ServiceDescriptor.RulesRegister client streaming method for the service.- Specified by:
clientStreamingin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
clientStreaming
public <ReqT,ResT> ServiceDescriptor.Builder clientStreaming(String name, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:ServiceDescriptor.RulesRegister client streaming method for the service.- Specified by:
clientStreamingin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
bidirectional
public <ReqT,ResT> ServiceDescriptor.Builder bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method) Description copied from interface:ServiceDescriptor.RulesRegister bi-directional streaming method for the service.- Specified by:
bidirectionalin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
bidirectional
public <ReqT,ResT> ServiceDescriptor.Builder bidirectional(String name, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT, ResT> method, MethodDescriptor.Configurer<ReqT, ResT> configurer) Description copied from interface:ServiceDescriptor.RulesRegister bi-directional streaming method for the service.- Specified by:
bidirectionalin interfaceServiceDescriptor.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
ServiceDescriptor.Rulesinstance for fluent call chaining
-
intercept
Description copied from interface:ServiceDescriptor.RulesAdd one or moreServerInterceptorinstances that will intercept calls to this service.If the added interceptors are annotated with the
Priorityannotation then that value will be used to assign a priority to use when applying the interceptor otherwise a priority ofInterceptorPriorities.USERwill be used.- Specified by:
interceptin interfaceServiceDescriptor.Rules- Parameters:
interceptors- one or moreServerInterceptors to add- Returns:
- this builder to allow fluent method chaining
-
intercept
Description copied from interface:ServiceDescriptor.RulesAdd one or moreServerInterceptorinstances that will intercept calls to this service.The added interceptors will be applied using the specified priority.
- Specified by:
interceptin interfaceServiceDescriptor.Rules- Parameters:
priority- the priority to assign to the interceptorsinterceptors- one or moreServerInterceptors to add- Returns:
- this builder to allow fluent method chaining
-
intercept
public ServiceDescriptor.Builder intercept(String methodName, io.grpc.ServerInterceptor... interceptors) Description copied from interface:ServiceDescriptor.RulesRegister one or moreinterceptorsfor a named method of the service.If the added interceptors are annotated with the
Priorityannotation then that value will be used to assign a priority to use when applying the interceptor otherwise a priority ofInterceptorPriorities.USERwill be used.- Specified by:
interceptin interfaceServiceDescriptor.Rules- Parameters:
methodName- the name of the method to interceptinterceptors- the interceptor(s) to register- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
intercept
public ServiceDescriptor.Builder intercept(String methodName, int priority, io.grpc.ServerInterceptor... interceptors) Description copied from interface:ServiceDescriptor.RulesRegister one or moreinterceptorsfor a named method of the service.The added interceptors will be applied using the specified priority.
- Specified by:
interceptin interfaceServiceDescriptor.Rules- Parameters:
methodName- the name of the method to interceptpriority- the priority to assign to the interceptorsinterceptors- the interceptor(s) to register- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
addContextValue
Description copied from interface:ServiceDescriptor.RulesAdd value to theContextfor the service.- Specified by:
addContextValuein interfaceServiceDescriptor.Rules- Type Parameters:
V- the type of the value- Parameters:
key- the key for the context valuevalue- the value to add- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
healthCheck
Description copied from interface:ServiceDescriptor.RulesRegister the serviceHealthCheck.- Specified by:
healthCheckin interfaceServiceDescriptor.Rules- Parameters:
healthCheck- the serviceHealthCheck- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<ServiceDescriptor.Builder,ServiceDescriptor> - Returns:
- instance of the built type
-
toString
-