public final class MultiServerCluster extends AbstractMultiServerCluster
| Constructor and Description |
|---|
MultiServerCluster(ClusterId clusterId,
ClusterSettings settings,
ClusterableServerFactory serverFactory) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
ClusterableServerFactory |
getServerFactory() |
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.
|
closepublic MultiServerCluster(ClusterId clusterId, ClusterSettings settings, ClusterableServerFactory serverFactory)
public BsonTimestamp getClusterTime()
ClustergetClusterTime in interface Clusterpublic Server selectServer(ServerSelector serverSelector)
ClusterselectServer in interface ClusterserverSelector - a ServerSelector that defines how to select the required Serverpublic void selectServerAsync(ServerSelector serverSelector, SingleResultCallback<Server> callback)
ClusterselectServerAsync in interface ClusterserverSelector - a ServerSelector that defines how to select the required Servercallback - the callback to invoke when the server is found or an error occurspublic ClusterDescription getDescription()
ClustergetDescription in interface Clusterpublic ClusterSettings getSettings()
ClustergetSettings in interface Clusterpublic ClusterableServerFactory getServerFactory()
public boolean isClosed()
Clusterpublic ClusterDescription getCurrentDescription()
ClustergetCurrentDescription in interface ClusterCopyright © 2010 - 2023 Adobe. All Rights Reserved