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
Modifier and TypeClassDescriptionstatic class
MethodDescriptor
builder implementation.static interface
ClientMethod configuration API. -
Method Summary
Modifier and TypeMethodDescriptionbidirectional
(String serviceName, String name) Creates a new bidirectionalGrpcClientMethodDescriptor.Builder
with the specified name.Creates a newGrpcClientMethodDescriptor.Builder
with the specified name andMethodDescriptor
.Creates a newGrpcClientMethodDescriptor.Builder
with the specified name.io.grpc.CallCredentials
Return theCallCredentials
set on this service.clientStreaming
(String serviceName, String name) Creates a new client StreamingGrpcClientMethodDescriptor.Builder
with the specified name.static GrpcClientMethodDescriptor
Creates a newGrpcClientMethodDescriptor.Builder
with the specified name andMethodDescriptor
.<ReqT,
RespT>
io.grpc.MethodDescriptor<ReqT, RespT> Returns theMethodDescriptor
of this method.MethodHandler
<?, ?> Obtain theMethodHandler
to use to make client calls.name()
Returns the simple name of the method.serverStreaming
(String serviceName, String name) Creates a new server streamingGrpcClientMethodDescriptor.Builder
with the specified name.io.grpc.MethodDescriptor.MethodType
type()
Returns theMethodDescriptor.MethodType
of this method.Creates a new unaryGrpcClientMethodDescriptor.Builder
with the specified name.
-
Method Details
-
builder
public static GrpcClientMethodDescriptor.Builder builder(String serviceName, String name, io.grpc.MethodDescriptor.Builder<?, ?> descriptor) Creates a newGrpcClientMethodDescriptor.Builder
with 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.Builder
with 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.Builder
with 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.Builder
with 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.Builder
with 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.Builder
with 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 theCallCredentials
set on this service.- Returns:
- the
CallCredentials
set on this service
-
builder
public static GrpcClientMethodDescriptor.Builder builder(String serviceName, String name, io.grpc.MethodDescriptor.MethodType methodType) Creates a newGrpcClientMethodDescriptor.Builder
with 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 theMethodDescriptor
of this method.- Type Parameters:
ReqT
- the request typeRespT
- the response type- Returns:
- The
MethodDescriptor
of this method.
-
type
public io.grpc.MethodDescriptor.MethodType type()Returns theMethodDescriptor.MethodType
of this method.- Returns:
- the method type
-
methodHandler
Obtain theMethodHandler
to use to make client calls.- Returns:
- the
MethodHandler
to use to make client calls
-