Class GrpcClients
URI or an EndpointGroup.-
Method Summary
Modifier and TypeMethodDescriptionstatic GrpcClientBuilderbuilder(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup) Returns a newGrpcClientBuilderthat builds the client that connects to the specifiedEndpointGroupwith the specifiedScheme.static GrpcClientBuilderbuilder(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup) Returns a newGrpcClientBuilderthat builds the gRPC client that connects to the specifiedEndpointGroupwith the specifiedSessionProtocolandGrpcSerializationFormats.PROTO.static GrpcClientBuilderReturns a newGrpcClientBuilderthat builds the client that connects to the specifieduri.static GrpcClientBuilderReturns a newGrpcClientBuilderthat builds the client that connects to the specifiedEndpointGroupwith the specifiedscheme.static GrpcClientBuilderReturns a newGrpcClientBuilderthat builds the client that connects to the specifiedURI.static <T> TnewClient(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedSchemeusing the defaultClientFactory.static <T> TnewClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedSessionProtocolandGrpcSerializationFormats.PROTOusing the defaultClientFactory.static <T> TnewClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedschemeusing the defaultClientFactory.static <T> TCreates a new gRPC client that connects to the specifieduriusing the defaultClientFactory.static <T> TCreates a new gRPC client that connects to the specifiedURIusing the defaultClientFactory.
-
Method Details
-
newClient
Creates a new gRPC client that connects to the specifieduriusing the defaultClientFactory.Note that if a
SerializationFormatis not specified in theSchemecomponent of theuri,GrpcSerializationFormats.PROTOwill be used by default.- Parameters:
uri- the URI of the server endpointclientType- the type of the new gRPC client- Throws:
IllegalArgumentException- if the specifieduriis invalid, or the specifiedclientTypeis an unsupported gRPC client stub.
-
newClient
Creates a new gRPC client that connects to the specifiedURIusing the defaultClientFactory.Note that if a
SerializationFormatis not specified in theSchemecomponent of theURI,GrpcSerializationFormats.PROTOwill be used by default.- Parameters:
uri- theURIof the server endpointclientType- the type of the new gRPC client- Throws:
IllegalArgumentException- if the specifieduriis invalid, or the specifiedclientTypeis an unsupported gRPC client stub.
-
newClient
public static <T> T newClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedschemeusing the defaultClientFactory.Note that if a
SerializationFormatis not specified in theSchemecomponent of theURI,GrpcSerializationFormats.PROTOwill be used by default.- Parameters:
scheme- theSchemerepresented as aStringendpointGroup- the serverEndpointGroupclientType- the type of the new gRPC client- Throws:
IllegalArgumentException- if the specifiedschemeis invalid or the specifiedclientTypeis an unsupported gRPC client stub.
-
newClient
public static <T> T newClient(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedSchemeusing the defaultClientFactory.Note that if a
SerializationFormatis not specified in theSchemecomponent of theURI,GrpcSerializationFormats.PROTOwill be used by default.- Parameters:
scheme- theSchemeendpointGroup- the serverEndpointGroupclientType- the type of the new gRPC client- Throws:
IllegalArgumentException- if the specifiedclientTypeis unsupported for the specifiedScheme.
-
newClient
public static <T> T newClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType) Creates a new gRPC client that connects to the specifiedEndpointGroupwith the specifiedSessionProtocolandGrpcSerializationFormats.PROTOusing the defaultClientFactory.- Parameters:
protocol- theSessionProtocolendpointGroup- the serverEndpointGroupclientType- the type of the new gRPC client- Throws:
IllegalArgumentException- if theclientTypeis an unsupported gRPC client stub.
-
builder
Returns a newGrpcClientBuilderthat builds the client that connects to the specifieduri.Note that if a
SerializationFormatis not specified in theSchemecomponent of theuri,GrpcSerializationFormats.PROTOwill be used by default.- Throws:
IllegalArgumentException- if the specifieduriis invalid, or theuri's scheme contains an invalidSerializationFormat.
-
builder
Returns a newGrpcClientBuilderthat builds the client that connects to the specifiedURI.Note that if a
SerializationFormatis not specified in theSchemecomponent of theURI,GrpcSerializationFormats.PROTOwill be used by default.- Throws:
IllegalArgumentException- if the specifiedURIis invalid, or theURI's scheme contains an invalidSerializationFormat.
-
builder
public static GrpcClientBuilder builder(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup) Returns a newGrpcClientBuilderthat builds the client that connects to the specifiedEndpointGroupwith the specifiedscheme.Note that if a
SerializationFormatis not specified in the givenscheme,GrpcSerializationFormats.PROTOwill be used by default.- Throws:
IllegalArgumentException- if theschemeis invalid.
-
builder
public static GrpcClientBuilder builder(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup) Returns a newGrpcClientBuilderthat builds the gRPC client that connects to the specifiedEndpointGroupwith the specifiedSessionProtocolandGrpcSerializationFormats.PROTO. -
builder
public static GrpcClientBuilder builder(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup) Returns a newGrpcClientBuilderthat builds the client that connects to the specifiedEndpointGroupwith the specifiedScheme.Note that if
SerializationFormat.NONEis specified in theScheme,GrpcSerializationFormats.PROTOwill be used by default.
-