Package io.helidon.grpc.server
Class ServiceDescriptor.Builder
- java.lang.Object
-
- io.helidon.grpc.server.ServiceDescriptor.Builder
-
- All Implemented Interfaces:
Builder<ServiceDescriptor>,ServiceDescriptor.Rules,Supplier<ServiceDescriptor>
- Enclosing class:
- ServiceDescriptor
public static final class ServiceDescriptor.Builder extends Object implements ServiceDescriptor.Rules, Builder<ServiceDescriptor>
AServiceDescriptorbuilder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> ServiceDescriptor.BuilderaddContextValue(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.ServiceDescriptorbuild()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.ServiceDescriptor.BuilderhealthCheck(HealthCheck healthCheck)Register the serviceHealthCheck.ServiceDescriptor.Builderintercept(int priority, io.grpc.ServerInterceptor... interceptors)Add one or moreServerInterceptorinstances that will intercept calls to this service.ServiceDescriptor.Builderintercept(io.grpc.ServerInterceptor... interceptors)Add one or moreServerInterceptorinstances that will intercept calls to this service.ServiceDescriptor.Builderintercept(String methodName, int priority, io.grpc.ServerInterceptor... interceptors)Register one or moreinterceptorsfor a named method of the service.ServiceDescriptor.Builderintercept(String methodName, io.grpc.ServerInterceptor... interceptors)Register one or moreinterceptorsfor a named method of the service.ServiceDescriptor.BuildermarshallerSupplier(MarshallerSupplier marshallerSupplier)Register theMarshallerSupplierfor the service.Stringname()Obtain the name fo the service this configuration configures.ServiceDescriptor.Buildername(String name)Set the name for the service.ServiceDescriptor.Builderproto(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.StringtoString()<ReqT,ResT>
ServiceDescriptor.Builderunary(String name, io.grpc.stub.ServerCalls.UnaryMethod<ReqT,ResT> method)Register 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 Detail
-
name
public String 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
public ServiceDescriptor.Builder name(String 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
public ServiceDescriptor.Builder proto(com.google.protobuf.Descriptors.FileDescriptor 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
public ServiceDescriptor.Builder marshallerSupplier(MarshallerSupplier 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
public ServiceDescriptor.Builder intercept(io.grpc.ServerInterceptor... interceptors)
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
public ServiceDescriptor.Builder intercept(int priority, io.grpc.ServerInterceptor... interceptors)
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
public <V> ServiceDescriptor.Builder addContextValue(io.grpc.Context.Key<V> key, V value)
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
public ServiceDescriptor.Builder healthCheck(HealthCheck 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
public ServiceDescriptor build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<ServiceDescriptor>- Returns:
- instance of the built type
-
-