public final class GrpcClients
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> |
forAddress(HostAndPort address)
|
static <U,R> GrpcClientBuilder<U,R> |
forAddress(ServiceDiscoverer<U,R,? extends ServiceDiscovererEvent<R>> serviceDiscoverer,
U address)
Creates a
GrpcClientBuilder for a custom address type with default LoadBalancer and user
provided ServiceDiscoverer . |
static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> |
forAddress(java.lang.String host,
int port)
|
static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> |
forResolvedAddress(HostAndPort address)
|
static GrpcClientBuilder<java.net.InetSocketAddress,java.net.InetSocketAddress> |
forResolvedAddress(java.net.InetSocketAddress address)
|
static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> |
forResolvedAddress(java.lang.String host,
int port)
Creates a
GrpcClientBuilder for a resolved address with default LoadBalancer . |
public static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> forAddress(java.lang.String host, int port)
host
- host to connect to, resolved by default using a DNS ServiceDiscoverer
.port
- port to connect topublic static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> forAddress(HostAndPort address)
address
- the UnresolvedAddress
to connect to, resolved by default using a DNS
ServiceDiscoverer
.public static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> forResolvedAddress(java.lang.String host, int port)
GrpcClientBuilder
for a resolved address with default LoadBalancer
.host
- resolved host address to connect to.port
- port to connect topublic static GrpcClientBuilder<HostAndPort,java.net.InetSocketAddress> forResolvedAddress(HostAndPort address)
address
- the ResolvedAddress
to connect to.public static GrpcClientBuilder<java.net.InetSocketAddress,java.net.InetSocketAddress> forResolvedAddress(java.net.InetSocketAddress address)
address
- the InetSocketAddress
to connect to.public static <U,R> GrpcClientBuilder<U,R> forAddress(ServiceDiscoverer<U,R,? extends ServiceDiscovererEvent<R>> serviceDiscoverer, U address)
GrpcClientBuilder
for a custom address type with default LoadBalancer
and user
provided ServiceDiscoverer
.U
- the type of address before resolution (unresolved address)R
- the type of address after resolution (resolved address)serviceDiscoverer
- The ServiceDiscoverer
to resolve addresses of remote servers to connect to.
The lifecycle of the provided ServiceDiscoverer
should be managed by the caller.address
- the UnresolvedAddress
to connect to resolved using the provided serviceDiscoverer
.