interface Cluster
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes connections to the servers in the cluster.
|
ClusterDescription |
getDescription(long maxWaitTime,
java.util.concurrent.TimeUnit timeUnit)
Get the description of this cluster.
|
Server |
getServer(ServerSelector serverSelector,
long maxWaitTime,
java.util.concurrent.TimeUnit timeUnit)
Get a MongoDB server that matches the criteria defined by the serverSelector
|
boolean |
isClosed()
Whether all the servers in the cluster are closed or not.
|
ClusterDescription getDescription(long maxWaitTime, java.util.concurrent.TimeUnit timeUnit)
maxWaitTime - the maximum time to wait for a connection to the cluster to get the descriptiontimeUnit - the TimeUnit for the maxWaitTimeMongoTimeoutException - if the timeout has been reached before the cluster type is knownServer getServer(ServerSelector serverSelector, long maxWaitTime, java.util.concurrent.TimeUnit timeUnit)
serverSelector - a ServerSelector that defines how to select the required ServermaxWaitTime - the maximum time to wait for a connection to the cluster to get a servertimeUnit - the TimeUnit for the maxWaitTimeMongoTimeoutException - if the timeout has been reached before a server matching the selector is availablevoid close()
boolean isClosed()