java.lang.Object
io.helidon.webclient.grpc.GrpcClientMethodDescriptor
Encapsulates all metadata necessary to define a gRPC method. In addition to wrapping
a
MethodDescriptor, this class also holds the request and response
types of the gRPC method. A GrpcServiceDescriptor
can contain zero or more MethodDescriptor.
An instance of ClientMethodDescriptor can be created either from an existing
MethodDescriptor or from one of the factory methods
bidirectional(String, String), clientStreaming(String, String),
serverStreaming(String, String) or unary(String, String).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMethodDescriptorbuilder implementation.static interfaceClientMethod configuration API. -
Method Summary
Modifier and TypeMethodDescriptionbidirectional(String serviceName, String name) Creates a new bidirectionalGrpcClientMethodDescriptor.Builderwith the specified name.Creates a newGrpcClientMethodDescriptor.Builderwith the specified name andMethodDescriptor.Creates a newGrpcClientMethodDescriptor.Builderwith the specified name.io.grpc.CallCredentialsReturn theCallCredentialsset on this service.clientStreaming(String serviceName, String name) Creates a new client StreamingGrpcClientMethodDescriptor.Builderwith the specified name.static GrpcClientMethodDescriptorCreates a newGrpcClientMethodDescriptor.Builderwith the specified name andMethodDescriptor.<ReqT,RespT>
io.grpc.MethodDescriptor<ReqT, RespT> Returns theMethodDescriptorof this method.MethodHandler<?, ?> Obtain theMethodHandlerto use to make client calls.name()Returns the simple name of the method.serverStreaming(String serviceName, String name) Creates a new server streamingGrpcClientMethodDescriptor.Builderwith the specified name.io.grpc.MethodDescriptor.MethodTypetype()Returns theMethodDescriptor.MethodTypeof this method.Creates a new unaryGrpcClientMethodDescriptor.Builderwith the specified name.
-
Method Details
-
builder
public static GrpcClientMethodDescriptor.Builder builder(String serviceName, String name, io.grpc.MethodDescriptor.Builder<?, ?> descriptor) Creates a newGrpcClientMethodDescriptor.Builderwith the specified name andMethodDescriptor.- Parameters:
serviceName- the name of the owning gRPC servicename- the simple method namedescriptor- the underlying gRPCMethodDescriptor.Builder- Returns:
- A new instance of a
GrpcClientMethodDescriptor.Builder
-
create
public static GrpcClientMethodDescriptor create(String serviceName, String name, io.grpc.MethodDescriptor.Builder<?, ?> descriptor) Creates a newGrpcClientMethodDescriptor.Builderwith the specified name andMethodDescriptor.- Parameters:
serviceName- the name of the owning gRPC servicename- the simple method namedescriptor- the underlying gRPCMethodDescriptor.Builder- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
unary
Creates a new unaryGrpcClientMethodDescriptor.Builderwith the specified name.- Parameters:
serviceName- the name of the owning gRPC servicename- the method name- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
clientStreaming
Creates a new client StreamingGrpcClientMethodDescriptor.Builderwith the specified name.- Parameters:
serviceName- the name of the owning gRPC servicename- the method name- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
serverStreaming
Creates a new server streamingGrpcClientMethodDescriptor.Builderwith the specified name.- Parameters:
serviceName- the name of the owning gRPC servicename- the method name- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
bidirectional
Creates a new bidirectionalGrpcClientMethodDescriptor.Builderwith the specified name.- Parameters:
serviceName- the name of the owning gRPC servicename- the method name- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
callCredentials
public io.grpc.CallCredentials callCredentials()Return theCallCredentialsset on this service.- Returns:
- the
CallCredentialsset on this service
-
builder
public static GrpcClientMethodDescriptor.Builder builder(String serviceName, String name, io.grpc.MethodDescriptor.MethodType methodType) Creates a newGrpcClientMethodDescriptor.Builderwith the specified name.- Parameters:
serviceName- the name of the owning gRPC servicename- the method namemethodType- the gRPC method type- Returns:
- a new instance of a
GrpcClientMethodDescriptor.Builder
-
name
Returns the simple name of the method.- Returns:
- The simple name of the method.
-
descriptor
public <ReqT,RespT> io.grpc.MethodDescriptor<ReqT,RespT> descriptor()Returns theMethodDescriptorof this method.- Type Parameters:
ReqT- the request typeRespT- the response type- Returns:
- The
MethodDescriptorof this method.
-
type
public io.grpc.MethodDescriptor.MethodType type()Returns theMethodDescriptor.MethodTypeof this method.- Returns:
- the method type
-
methodHandler
Obtain theMethodHandlerto use to make client calls.- Returns:
- the
MethodHandlerto use to make client calls
-