AutoCloseable
, Closeable
public interface Cluster extends Closeable
Modifier and Type | Method | Description |
---|---|---|
void |
closeβ() |
Closes connections to the servers in the cluster.
|
BsonTimestamp |
getClusterTimeβ() |
Get the last seen cluster time
|
ClusterDescription |
getCurrentDescriptionβ() |
Get the current description of this cluster.
|
ClusterDescription |
getDescriptionβ() |
Get the description of this cluster.
|
ClusterSettings |
getSettingsβ() |
Gets the cluster settings with which this cluster was created.
|
boolean |
isClosedβ() |
Whether all the servers in the cluster are closed or not.
|
Server |
selectServerβ(ServerSelector serverSelector) |
Get a MongoDB server that matches the criteria defined by the serverSelector
|
void |
selectServerAsyncβ(ServerSelector serverSelector,
SingleResultCallback<Server> callback) |
Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.
|
ClusterSettings getSettingsβ()
ClusterDescription getDescriptionβ()
MongoTimeoutException
- if the timeout has been reached before the cluster type is knownClusterDescription getCurrentDescriptionβ()
@Nullable BsonTimestamp getClusterTimeβ()
Server selectServerβ(ServerSelector serverSelector)
serverSelector
- a ServerSelector that defines how to select the required ServerMongoTimeoutException
- if the timeout has been reached before a server matching the selector is availablevoid selectServerAsyncβ(ServerSelector serverSelector, SingleResultCallback<Server> callback)
serverSelector
- a ServerSelector that defines how to select the required Servercallback
- the callback to invoke when the server is found or an error occursvoid closeβ()
close
in interface AutoCloseable
close
in interface Closeable
boolean isClosedβ()