Class GrpcClients
URI
or an EndpointGroup
.-
Method Summary
Modifier and TypeMethodDescriptionstatic GrpcClientBuilder
builder
(Scheme scheme, EndpointGroup endpointGroup) Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedEndpointGroup
with the specifiedScheme
.static GrpcClientBuilder
builder
(SessionProtocol protocol, EndpointGroup endpointGroup) Returns a newGrpcClientBuilder
that builds the gRPC client that connects to the specifiedEndpointGroup
with the specifiedSessionProtocol
andGrpcSerializationFormats.PROTO
.static GrpcClientBuilder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifieduri
.static GrpcClientBuilder
builder
(String scheme, EndpointGroup endpointGroup) Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedEndpointGroup
with the specifiedscheme
.static GrpcClientBuilder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedURI
.static <T> T
newClient
(Scheme scheme, EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedScheme
using the defaultClientFactory
.static <T> T
newClient
(SessionProtocol protocol, EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedSessionProtocol
andGrpcSerializationFormats.PROTO
using the defaultClientFactory
.static <T> T
newClient
(String scheme, EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedscheme
using the defaultClientFactory
.static <T> T
Creates a new gRPC client that connects to the specifieduri
using the defaultClientFactory
.static <T> T
Creates a new gRPC client that connects to the specifiedURI
using the defaultClientFactory
.
-
Method Details
-
newClient
Creates a new gRPC client that connects to the specifieduri
using the defaultClientFactory
.Note that if a
SerializationFormat
is not specified in theScheme
component of theuri
,GrpcSerializationFormats.PROTO
will be used by default.- Parameters:
uri
- the URI of the server endpointclientType
- the type of the new gRPC client- Throws:
IllegalArgumentException
- if the specifieduri
is invalid, or the specifiedclientType
is an unsupported gRPC client stub.
-
newClient
Creates a new gRPC client that connects to the specifiedURI
using the defaultClientFactory
.Note that if a
SerializationFormat
is not specified in theScheme
component of theURI
,GrpcSerializationFormats.PROTO
will be used by default.- Parameters:
uri
- theURI
of the server endpointclientType
- the type of the new gRPC client- Throws:
IllegalArgumentException
- if the specifieduri
is invalid, or the specifiedclientType
is an unsupported gRPC client stub.
-
newClient
Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedscheme
using the defaultClientFactory
.Note that if a
SerializationFormat
is not specified in theScheme
component of theURI
,GrpcSerializationFormats.PROTO
will be used by default.- Parameters:
scheme
- theScheme
represented as aString
endpointGroup
- the serverEndpointGroup
clientType
- the type of the new gRPC client- Throws:
IllegalArgumentException
- if the specifiedscheme
is invalid or the specifiedclientType
is an unsupported gRPC client stub.
-
newClient
Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedScheme
using the defaultClientFactory
.Note that if a
SerializationFormat
is not specified in theScheme
component of theURI
,GrpcSerializationFormats.PROTO
will be used by default.- Parameters:
scheme
- theScheme
endpointGroup
- the serverEndpointGroup
clientType
- the type of the new gRPC client- Throws:
IllegalArgumentException
- if the specifiedclientType
is unsupported for the specifiedScheme
.
-
newClient
public static <T> T newClient(SessionProtocol protocol, EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroup
with the specifiedSessionProtocol
andGrpcSerializationFormats.PROTO
using the defaultClientFactory
.- Parameters:
protocol
- theSessionProtocol
endpointGroup
- the serverEndpointGroup
clientType
- the type of the new gRPC client- Throws:
IllegalArgumentException
- if theclientType
is an unsupported gRPC client stub.
-
builder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifieduri
.Note that if a
SerializationFormat
is not specified in theScheme
component of theuri
,GrpcSerializationFormats.PROTO
will be used by default.- Throws:
IllegalArgumentException
- if the specifieduri
is invalid, or theuri
's scheme contains an invalidSerializationFormat
.
-
builder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedURI
.Note that if a
SerializationFormat
is not specified in theScheme
component of theURI
,GrpcSerializationFormats.PROTO
will be used by default.- Throws:
IllegalArgumentException
- if the specifiedURI
is invalid, or theURI
's scheme contains an invalidSerializationFormat
.
-
builder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedEndpointGroup
with the specifiedscheme
.Note that if a
SerializationFormat
is not specified in the givenscheme
,GrpcSerializationFormats.PROTO
will be used by default.- Throws:
IllegalArgumentException
- if thescheme
is invalid.
-
builder
Returns a newGrpcClientBuilder
that builds the gRPC client that connects to the specifiedEndpointGroup
with the specifiedSessionProtocol
andGrpcSerializationFormats.PROTO
. -
builder
Returns a newGrpcClientBuilder
that builds the client that connects to the specifiedEndpointGroup
with the specifiedScheme
.Note that if
SerializationFormat.NONE
is specified in theScheme
,GrpcSerializationFormats.PROTO
will be used by default.
-