public interface ServerPool
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptDiscoveredUrls(@NonNull java.util.List<java.lang.String> discoveredServers)
When the connection received discovered servers (ServerInfo.getConnectURLs)
it passes them on to the provider for later use
|
void |
connectFailed(@NonNull io.nats.client.support.NatsUri nuri)
Indicate that the connection to this NatsUri failed.
|
void |
connectSucceeded(@NonNull io.nats.client.support.NatsUri nuri)
Indicate that the connection to this NatsUri succeeded.
|
@NonNull java.util.List<java.lang.String> |
getServerList()
Get the list of servers known to the pool.
|
boolean |
hasSecureServer()
Whether the pool has any server with a secure scheme
|
void |
initialize(@NonNull Options opts)
Initialize the pool.
|
@Nullable io.nats.client.support.NatsUri |
nextServer()
Get the next server to try to connect to.
|
@Nullable io.nats.client.support.NatsUri |
peekNextServer()
Just take a peek at the next server without doing any processing.
|
@Nullable java.util.List<java.lang.String> |
resolveHostToIps(@NonNull java.lang.String host)
Resolve a host name to an ip address
|
void initialize(@NonNull Options opts)
opts - the options that was used to make the connection is suppliedboolean acceptDiscoveredUrls(@NonNull java.util.List<java.lang.String> discoveredServers)
discoveredServers - the list of discovered servers.@Nullable io.nats.client.support.NatsUri peekNextServer()
@Nullable io.nats.client.support.NatsUri nextServer()
@Nullable java.util.List<java.lang.String> resolveHostToIps(@NonNull java.lang.String host)
host - the host to resolvevoid connectSucceeded(@NonNull io.nats.client.support.NatsUri nuri)
nuri - should match the NatsUri given by nextServervoid connectFailed(@NonNull io.nats.client.support.NatsUri nuri)
nuri - should match the NatsUri given by nextServer@NonNull java.util.List<java.lang.String> getServerList()
boolean hasSecureServer()