public class SocketAddressSupplier extends Object implements Supplier<SocketAddress>
timeoutMS() the other connections will be attempted. The order of these
connections are determined by the order of the connectURIs| Modifier and Type | Class and Description |
|---|---|
static class |
SocketAddressSupplier.RemoteAddressSupplier |
| Constructor and Description |
|---|
SocketAddressSupplier(@NotNull String[] connectURIs,
@NotNull String name) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull List<SocketAddressSupplier.RemoteAddressSupplier> |
all() |
void |
failoverToNextAddress() |
@Nullable InetSocketAddress |
get() |
@Nullable String |
getDescription() |
int |
index() |
@NotNull String |
log(SocketAddressSupplier.RemoteAddressSupplier current) |
@NotNull String |
name() |
String |
remoteAddresses() |
void |
resetToPrimary()
reset back to the primary
|
int |
size() |
long |
timeoutMS() |
@NotNull String |
toString() |
static @NotNull SocketAddressSupplier |
uri(String connectURI)
use this method if you only want to connect to a single server
|
@NotNull public static @NotNull SocketAddressSupplier uri(String connectURI)
connectURI - the uri of the server@NotNull public @NotNull List<SocketAddressSupplier.RemoteAddressSupplier> all()
@NotNull public @NotNull String name()
public void failoverToNextAddress()
public void resetToPrimary()
public int size()
public int index()
public long timeoutMS()
@Nullable public @Nullable InetSocketAddress get()
get in interface Supplier<SocketAddress>@Nullable public @Nullable String getDescription()
public String remoteAddresses()
@NotNull public @NotNull String log(SocketAddressSupplier.RemoteAddressSupplier current)
Copyright © 2023. All rights reserved.