Package com.mongodb.internal.connection
Class MultiServerCluster
- java.lang.Object
-
- com.mongodb.internal.connection.AbstractMultiServerCluster
-
- com.mongodb.internal.connection.MultiServerCluster
-
- All Implemented Interfaces:
Cluster
,java.io.Closeable
,java.lang.AutoCloseable
@Deprecated(since="2021-05-27") public final class MultiServerCluster extends AbstractMultiServerCluster
Deprecated.
-
-
Constructor Summary
Constructors Constructor Description MultiServerCluster(ClusterId clusterId, ClusterSettings settings, ClusterableServerFactory serverFactory)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BsonTimestamp
getClusterTime()
Deprecated.Get the last seen cluster timeClusterDescription
getCurrentDescription()
Deprecated.Get the current description of this cluster.ClusterDescription
getDescription()
Deprecated.Get the description of this cluster.ClusterableServerFactory
getServerFactory()
Deprecated.ClusterSettings
getSettings()
Deprecated.Gets the cluster settings with which this cluster was created.boolean
isClosed()
Deprecated.Whether all the servers in the cluster are closed or not.Server
selectServer(ServerSelector serverSelector)
Deprecated.Get a MongoDB server that matches the criteria defined by the serverSelectorvoid
selectServerAsync(ServerSelector serverSelector, SingleResultCallback<Server> callback)
Deprecated.Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.-
Methods inherited from class com.mongodb.internal.connection.AbstractMultiServerCluster
close
-
-
-
-
Constructor Detail
-
MultiServerCluster
public MultiServerCluster(ClusterId clusterId, ClusterSettings settings, ClusterableServerFactory serverFactory)
Deprecated.
-
-
Method Detail
-
getClusterTime
public BsonTimestamp getClusterTime()
Deprecated.Description copied from interface:Cluster
Get the last seen cluster time- Specified by:
getClusterTime
in interfaceCluster
- Returns:
- the last seen cluster time or null if not set
-
selectServer
public Server selectServer(ServerSelector serverSelector)
Deprecated.Description copied from interface:Cluster
Get a MongoDB server that matches the criteria defined by the serverSelector- Specified by:
selectServer
in interfaceCluster
- Parameters:
serverSelector
- a ServerSelector that defines how to select the required Server- Returns:
- a Server that meets the requirements
-
selectServerAsync
public void selectServerAsync(ServerSelector serverSelector, SingleResultCallback<Server> callback)
Deprecated.Description copied from interface:Cluster
Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.- Specified by:
selectServerAsync
in interfaceCluster
- Parameters:
serverSelector
- a ServerSelector that defines how to select the required Servercallback
- the callback to invoke when the server is found or an error occurs
-
getDescription
public ClusterDescription getDescription()
Deprecated.Description copied from interface:Cluster
Get the description of this cluster. This method will not return normally until the cluster type is known.- Specified by:
getDescription
in interfaceCluster
- Returns:
- a ClusterDescription representing the current state of the cluster
-
getSettings
public ClusterSettings getSettings()
Deprecated.Description copied from interface:Cluster
Gets the cluster settings with which this cluster was created.- Specified by:
getSettings
in interfaceCluster
- Returns:
- the cluster settings
-
getServerFactory
public ClusterableServerFactory getServerFactory()
Deprecated.
-
isClosed
public boolean isClosed()
Deprecated.Description copied from interface:Cluster
Whether all the servers in the cluster are closed or not.
-
getCurrentDescription
public ClusterDescription getCurrentDescription()
Deprecated.Description copied from interface:Cluster
Get the current description of this cluster.- Specified by:
getCurrentDescription
in interfaceCluster
- Returns:
- the current ClusterDescription representing the current state of the cluster.
-
-