public final class DnsMultiServerCluster extends AbstractMultiServerCluster
| Constructor and Description |
|---|
DnsMultiServerCluster(ClusterId clusterId,
ClusterSettings settings,
ClusterableServerFactory serverFactory,
DnsSrvRecordMonitorFactory dnsSrvRecordMonitorFactory) |
| Modifier and Type | Method and 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.
|
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.
|
public DnsMultiServerCluster(ClusterId clusterId, ClusterSettings settings, ClusterableServerFactory serverFactory, DnsSrvRecordMonitorFactory dnsSrvRecordMonitorFactory)
public void close()
Clusterclose in interface Clusterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AbstractMultiServerClusterpublic 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