Interface GrpcServiceDescriptor.Rules

All Known Implementing Classes:
GrpcServiceDescriptor.Builder
Enclosing class:
GrpcServiceDescriptor

public static interface GrpcServiceDescriptor.Rules
Fluent configuration interface for the GrpcServiceDescriptor.
  • Method Details

    • name

      Set the name for the service.
      Parameters:
      name - the service name
      Returns:
      this GrpcServiceDescriptor.Rules instance for fluent call chaining
      Throws:
      NullPointerException - if the name is null
      IllegalArgumentException - 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

      GrpcServiceDescriptor.Rules proto(com.google.protobuf.Descriptors.FileDescriptor proto)
      Register the proto for the service.
      Parameters:
      proto - the service proto
      Returns:
      this GrpcServiceDescriptor.Rules instance for fluent call chaining
    • marshallerSupplier

      GrpcServiceDescriptor.Rules marshallerSupplier(MarshallerSupplier marshallerSupplier)
      Register the MarshallerSupplier for the service.
      Parameters:
      marshallerSupplier - the MarshallerSupplier for the service
      Returns:
      this GrpcServiceDescriptor.Rules instance for fluent call chaining
    • intercept

      GrpcServiceDescriptor.Rules intercept(io.grpc.ServerInterceptor... interceptors)
      Add one or more ServerInterceptor 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 of InterceptorWeights.USER will be used.

      Parameters:
      interceptors - one or more ServerInterceptors to add
      Returns:
      this builder to allow fluent method chaining
    • intercept

      GrpcServiceDescriptor.Rules intercept(int priority, io.grpc.ServerInterceptor... interceptors)
      Add one or more ServerInterceptor instances 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 interceptors
      interceptors - one or more ServerInterceptors to add
      Returns:
      this builder to allow fluent method chaining
    • intercept

      GrpcServiceDescriptor.Rules intercept(String methodName, io.grpc.ServerInterceptor... interceptors)
      Register one or more interceptors 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 of InterceptorWeights.USER will be used.

      Parameters:
      methodName - the name of the method to intercept
      interceptors - the interceptor(s) to register
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 more interceptors for a named method of the service.

      The added interceptors will be applied using the specified priority.

      Parameters:
      methodName - the name of the method to intercept
      priority - the priority to assign to the interceptors
      interceptors - the interceptor(s) to register
      Returns:
      this GrpcServiceDescriptor.Rules instance for fluent call chaining
      Throws:
      IllegalArgumentException - if no method exists for the specified name
    • addContextValue

      <V> GrpcServiceDescriptor.Rules addContextValue(io.grpc.Context.Key<V> key, V value)
      Add value to the Context for the service.
      Type Parameters:
      V - the type of the value
      Parameters:
      key - the key for the context value
      value - the value to add
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the unary method to register
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the unary method to register
      configurer - the method configurer
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the server streaming method to register
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the server streaming method to register
      configurer - the method configurer
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the client streaming method to register
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the client streaming method to register
      configurer - the method configurer
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the bi-directional streaming method to register
      Returns:
      this GrpcServiceDescriptor.Rules instance 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 type
      ResT - the method response type
      Parameters:
      name - the name of the method
      method - the bi-directional streaming method to register
      configurer - the method configurer
      Returns:
      this GrpcServiceDescriptor.Rules instance for fluent call chaining