Interface ClientServiceDescriptor.Rules
- All Known Implementing Classes:
ClientServiceDescriptor.Builder
- Enclosing class:
ClientServiceDescriptor
public static interface ClientServiceDescriptor.Rules
Fluent configuration interface for the
ClientServiceDescriptor
.-
Method Summary
Modifier and TypeMethodDescriptionbidirectional
(String name) Register bi-directional streaming method for the service.bidirectional
(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register bi-directional streaming method for the service.callCredentials
(io.grpc.CallCredentials callCredentials) Register theCallCredentials
to be used for this service.callCredentials
(String name, io.grpc.CallCredentials callCredentials) Register theCallCredentials
to be used for the specified method in this service.clientStreaming
(String name) Register client streaming method for the service.clientStreaming
(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register client streaming method for the service.intercept
(int priority, io.grpc.ClientInterceptor... interceptors) Add one or moreClientInterceptor
instances that will intercept calls to this service.intercept
(io.grpc.ClientInterceptor... interceptors) Register one or moreinterceptors
for the 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 file for the service.serverStreaming
(String name) Register server streaming method for the service.serverStreaming
(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register server streaming method for the service.Register unary method for the service.unary
(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register unary method for the service.
-
Method Details
-
name
String name()Obtain the name fo the service this configuration configures.- Returns:
- the name fo the service this configuration configures
-
name
Set the name for the service.- Parameters:
name
- the name of service- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining - Throws:
NullPointerException
- if the getName is nullIllegalArgumentException
- if the getName is a blank String
-
proto
Register the proto file for the service.- Parameters:
proto
- the service proto- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
marshallerSupplier
Register theMarshallerSupplier
for the service.- Parameters:
marshallerSupplier
- theMarshallerSupplier
for the service- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
intercept
Register one or moreinterceptors
for the service.- Parameters:
interceptors
- the interceptor(s) to register- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
intercept
Add one or moreClientInterceptor
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 interceptorsinterceptors
- one or moreClientInterceptor
s to add- Returns:
- this builder to allow fluent method chaining
-
intercept
ClientServiceDescriptor.Rules intercept(String methodName, io.grpc.ClientInterceptor... interceptors) Register one or moreinterceptors
for a named method of the service.- Parameters:
methodName
- the name of the method to interceptinterceptors
- the interceptor(s) to register- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining - Throws:
IllegalArgumentException
- if no method exists for the specified getName
-
intercept
ClientServiceDescriptor.Rules intercept(String methodName, int priority, io.grpc.ClientInterceptor... interceptors) Register one or moreinterceptors
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 interceptpriority
- the priority to assign to the interceptorsinterceptors
- the interceptor(s) to register- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining - Throws:
IllegalArgumentException
- if no method exists for the specified name
-
unary
Register unary method for the service.- Parameters:
name
- The getName of the method- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
unary
Register unary method for the service.- Parameters:
name
- the name of the methodconfigurer
- the method configurer- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
serverStreaming
Register server streaming method for the service.- Parameters:
name
- The name of the method- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
serverStreaming
ClientServiceDescriptor.Rules serverStreaming(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register server streaming method for the service.- Parameters:
name
- the name of the methodconfigurer
- the method configurer- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
clientStreaming
Register client streaming method for the service.- Parameters:
name
- The name of the method- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
clientStreaming
ClientServiceDescriptor.Rules clientStreaming(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register client streaming method for the service.- Parameters:
name
- the name of the methodconfigurer
- the method configurer- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
bidirectional
Register bi-directional streaming method for the service.- Parameters:
name
- The name of the method- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
bidirectional
ClientServiceDescriptor.Rules bidirectional(String name, Consumer<ClientMethodDescriptor.Rules> configurer) Register bi-directional streaming method for the service.- Parameters:
name
- the name of the methodconfigurer
- the method configurer- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
callCredentials
Register theCallCredentials
to be used for this service.- Parameters:
callCredentials
- theCallCredentials
to set.- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-
callCredentials
Register theCallCredentials
to be used for the specified method in this service. This overrides anyCallCredentials
set on thisClientServiceDescriptor
- Parameters:
name
- the method namecallCredentials
- theCallCredentials
to set.- Returns:
- this
ClientServiceDescriptor.Rules
instance for fluent call chaining
-