Package com.mongodb.connection
Class ClusterDescription
- java.lang.Object
-
- com.mongodb.connection.ClusterDescription
-
@Immutable @Deprecated(since="2021-05-27") public class ClusterDescription extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.Immutable snapshot state of a cluster.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, MongoException srvResolutionException, java.util.List<ServerDescription> serverDescriptions, ClusterSettings clusterSettings, ServerSettings serverSettings)
Deprecated.Creates a new ClusterDescription.ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, java.util.List<ServerDescription> serverDescriptions)
Deprecated.Creates a new ClusterDescription.ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, java.util.List<ServerDescription> serverDescriptions, ClusterSettings clusterSettings, ServerSettings serverSettings)
Deprecated.Creates a new ClusterDescription.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Deprecated.ServerDescription
findServerIncompatiblyNewerThanDriver()
Deprecated.Return a server in the cluster that is incompatibly newer than the driver.ServerDescription
findServerIncompatiblyOlderThanDriver()
Deprecated.Return a server in the cluster that is incompatibly older than the driver.java.util.Set<ServerDescription>
getAll()
Deprecated.UsegetServerDescriptions()
insteadjava.util.List<ServerDescription>
getAny()
Deprecated.Replace with a filter on ServerDescription in the callerjava.util.List<ServerDescription>
getAnyPrimaryOrSecondary()
Deprecated.Replace with a filter on ServerDescription in the callerjava.util.List<ServerDescription>
getAnyPrimaryOrSecondary(TagSet tagSet)
Deprecated.Replace with a filter on ServerDescription in the callerServerDescription
getByServerAddress(ServerAddress serverAddress)
Deprecated.Replace with a filter on ServerDescription in the callerClusterSettings
getClusterSettings()
Deprecated.Gets the cluster settings, which may be null if not provided.ClusterConnectionMode
getConnectionMode()
Deprecated.Gets whether this cluster is connecting to a single server or multiple servers.java.lang.Integer
getLogicalSessionTimeoutMinutes()
Deprecated.Gets the logical session timeout in minutes, or null if at least one of the known servers does not support logical sessions.java.util.List<ServerDescription>
getPrimaries()
Deprecated.Replace with a filter on ServerDescription in the callerjava.util.List<ServerDescription>
getSecondaries()
Deprecated.Replace with a filter on ServerDescription in the callerjava.util.List<ServerDescription>
getSecondaries(TagSet tagSet)
Deprecated.Replace with a filter on ServerDescription in the callerjava.util.List<ServerDescription>
getServerDescriptions()
Deprecated.Returns an unmodifiable list of the server descriptions in this cluster description.ServerSettings
getServerSettings()
Deprecated.Gets the server settings, which may be null if not provided.java.lang.String
getShortDescription()
Deprecated.Returns a short, pretty description for this ClusterDescription.MongoException
getSrvResolutionException()
Deprecated.Gets any exception encountered while resolving the SRV record for the initial host.ClusterType
getType()
Deprecated.Gets the specific type of this clusterint
hashCode()
Deprecated.boolean
hasReadableServer(ReadPreference readPreference)
Deprecated.Returns true if this cluster has at least one server that satisfies the given read preference.boolean
hasWritableServer()
Deprecated.Returns true if this cluster has at least one server that can be used for write operations.boolean
isCompatibleWithDriver()
Deprecated.Return whether all servers in the cluster are compatible with the driver.java.lang.String
toString()
Deprecated.
-
-
-
Constructor Detail
-
ClusterDescription
public ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, java.util.List<ServerDescription> serverDescriptions)
Deprecated.Creates a new ClusterDescription.- Parameters:
connectionMode
- whether to connect directly to a single server or to multiple serverstype
- what sort of cluster this isserverDescriptions
- the descriptions of all the servers currently in this cluster
-
ClusterDescription
public ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, java.util.List<ServerDescription> serverDescriptions, ClusterSettings clusterSettings, ServerSettings serverSettings)
Deprecated.Creates a new ClusterDescription.- Parameters:
connectionMode
- whether to connect directly to a single server or to multiple serverstype
- what sort of cluster this isserverDescriptions
- the descriptions of all the servers currently in this clusterclusterSettings
- the cluster settingsserverSettings
- the server settings- Since:
- 3.4
-
ClusterDescription
public ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, MongoException srvResolutionException, java.util.List<ServerDescription> serverDescriptions, ClusterSettings clusterSettings, ServerSettings serverSettings)
Deprecated.Creates a new ClusterDescription.- Parameters:
connectionMode
- whether to connect directly to a single server or to multiple serverstype
- what sort of cluster this issrvResolutionException
- an exception resolving the SRV recordserverDescriptions
- the descriptions of all the servers currently in this clusterclusterSettings
- the cluster settingsserverSettings
- the server settings- Since:
- 3.10
-
-
Method Detail
-
getClusterSettings
public ClusterSettings getClusterSettings()
Deprecated.Gets the cluster settings, which may be null if not provided.- Returns:
- the cluster settings
- Since:
- 3.4
-
getServerSettings
public ServerSettings getServerSettings()
Deprecated.Gets the server settings, which may be null if not provided.- Returns:
- the server settings
- Since:
- 3.4
-
isCompatibleWithDriver
public boolean isCompatibleWithDriver()
Deprecated.Return whether all servers in the cluster are compatible with the driver.- Returns:
- true if all servers in the cluster are compatible with the driver
-
findServerIncompatiblyOlderThanDriver
public ServerDescription findServerIncompatiblyOlderThanDriver()
Deprecated.Return a server in the cluster that is incompatibly older than the driver.- Returns:
- a server in the cluster that is incompatibly older than the driver, or null if there are none
- Since:
- 3.6
-
findServerIncompatiblyNewerThanDriver
public ServerDescription findServerIncompatiblyNewerThanDriver()
Deprecated.Return a server in the cluster that is incompatibly newer than the driver.- Returns:
- a server in the cluster that is incompatibly newer than the driver, or null if there are none
- Since:
- 3.6
-
hasReadableServer
public boolean hasReadableServer(ReadPreference readPreference)
Deprecated.Returns true if this cluster has at least one server that satisfies the given read preference.- Parameters:
readPreference
- the non-null read preference- Returns:
- whether this cluster has at least one server that satisfies the given read preference
- Since:
- 3.3
-
hasWritableServer
public boolean hasWritableServer()
Deprecated.Returns true if this cluster has at least one server that can be used for write operations.- Returns:
- true if this cluster has at least one server that can be used for write operations
- Since:
- 3.3
-
getConnectionMode
public ClusterConnectionMode getConnectionMode()
Deprecated.Gets whether this cluster is connecting to a single server or multiple servers.- Returns:
- the ClusterConnectionMode for this cluster
-
getType
public ClusterType getType()
Deprecated.Gets the specific type of this cluster- Returns:
- a ClusterType enum representing the type of this cluster
-
getSrvResolutionException
public MongoException getSrvResolutionException()
Deprecated.Gets any exception encountered while resolving the SRV record for the initial host.- Returns:
- any exception encountered while resolving the SRV record for the initial host, or null if none
- Since:
- 3.10
-
getServerDescriptions
public java.util.List<ServerDescription> getServerDescriptions()
Deprecated.Returns an unmodifiable list of the server descriptions in this cluster description.- Returns:
- an unmodifiable list of the server descriptions in this cluster description
- Since:
- 3.3
-
getLogicalSessionTimeoutMinutes
public java.lang.Integer getLogicalSessionTimeoutMinutes()
Deprecated.Gets the logical session timeout in minutes, or null if at least one of the known servers does not support logical sessions.- Returns:
- the logical session timeout in minutes, which may be null
- Since:
- 3.6
-
getAll
@Deprecated public java.util.Set<ServerDescription> getAll()
Deprecated.UsegetServerDescriptions()
insteadReturns the Set of all server descriptions in this cluster, sorted by the String value of the ServerAddress of each one.- Returns:
- the set of server descriptions
-
getByServerAddress
@Deprecated public ServerDescription getByServerAddress(ServerAddress serverAddress)
Deprecated.Replace with a filter on ServerDescription in the callerReturns the ServerDescription for the server at the given address- Parameters:
serverAddress
- the ServerAddress for a server in this cluster- Returns:
- the ServerDescription for this server
-
getPrimaries
@Deprecated public java.util.List<ServerDescription> getPrimaries()
Deprecated.Replace with a filter on ServerDescription in the callerWhile it may seem counter-intuitive that a MongoDB cluster can have more than one primary, it can in the case where the client's view of the cluster is a set of mongos servers, any of which can serve as the primary.- Returns:
- a list of servers that can act as primaries
-
getSecondaries
@Deprecated public java.util.List<ServerDescription> getSecondaries()
Deprecated.Replace with a filter on ServerDescription in the callerGet a list of all the secondaries in this cluster- Returns:
- a List of ServerDescriptions of all the secondaries this cluster is currently aware of
-
getSecondaries
@Deprecated public java.util.List<ServerDescription> getSecondaries(TagSet tagSet)
Deprecated.Replace with a filter on ServerDescription in the callerGet a list of all the secondaries in this cluster that match a given TagSet- Parameters:
tagSet
- a Set of replica set tags- Returns:
- a List of ServerDescriptions of all the secondaries this cluster that match all of the given tags
-
getAny
@Deprecated public java.util.List<ServerDescription> getAny()
Deprecated.Replace with a filter on ServerDescription in the callerGets a list of ServerDescriptions for all the servers in this cluster which are currently accessible.- Returns:
- a List of ServerDescriptions for all servers that have a status of OK
-
getAnyPrimaryOrSecondary
@Deprecated public java.util.List<ServerDescription> getAnyPrimaryOrSecondary()
Deprecated.Replace with a filter on ServerDescription in the callerGets a list of all the primaries and secondaries in this cluster.- Returns:
- a list of ServerDescriptions for all primary and secondary servers
-
getAnyPrimaryOrSecondary
@Deprecated public java.util.List<ServerDescription> getAnyPrimaryOrSecondary(TagSet tagSet)
Deprecated.Replace with a filter on ServerDescription in the callerGets a list of all the primaries and secondaries in this cluster that match the given replica set tags.- Parameters:
tagSet
- a Set of replica set tags- Returns:
- a list of ServerDescriptions for all primary and secondary servers that contain all of the given tags
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
getShortDescription
public java.lang.String getShortDescription()
Deprecated.Returns a short, pretty description for this ClusterDescription.- Returns:
- a String describing this cluster.
-
-