@Immutable public class ClusterDescription extends java.lang.Object
| 构造器和说明 |
|---|
ClusterDescription(ClusterConnectionMode connectionMode,
ClusterType type,
java.util.List<ServerDescription> serverDescriptions)
Creates a new ClusterDescription.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.Set<ServerDescription> |
getAll()
已过时。
Use
getServerDescriptions() instead |
java.util.List<ServerDescription> |
getAny()
已过时。
Replace with a filter on ServerDescription in the caller
|
java.util.List<ServerDescription> |
getAnyPrimaryOrSecondary()
已过时。
Replace with a filter on ServerDescription in the caller
|
java.util.List<ServerDescription> |
getAnyPrimaryOrSecondary(TagSet tagSet)
已过时。
Replace with a filter on ServerDescription in the caller
|
ServerDescription |
getByServerAddress(ServerAddress serverAddress)
已过时。
Replace with a filter on ServerDescription in the caller
|
ClusterConnectionMode |
getConnectionMode()
Gets whether this cluster is connecting to a single server or multiple servers.
|
java.util.List<ServerDescription> |
getPrimaries()
已过时。
Replace with a filter on ServerDescription in the caller
|
java.util.List<ServerDescription> |
getSecondaries()
已过时。
Replace with a filter on ServerDescription in the caller
|
java.util.List<ServerDescription> |
getSecondaries(TagSet tagSet)
已过时。
Replace with a filter on ServerDescription in the caller
|
java.util.List<ServerDescription> |
getServerDescriptions()
Returns an unmodifiable list of the server descriptions in this cluster description.
|
java.lang.String |
getShortDescription()
Returns a short, pretty description for this ClusterDescription.
|
ClusterType |
getType()
Gets the specific type of this cluster
|
int |
hashCode() |
boolean |
hasReadableServer(ReadPreference readPreference)
Returns true if this cluster has at least one server that satisfies the given read preference.
|
boolean |
hasWritableServer()
Returns true if this cluster has at least one server that can be used for write operations.
|
boolean |
isCompatibleWithDriver()
Return whether the cluster is compatible with the driver.
|
java.lang.String |
toString() |
public ClusterDescription(ClusterConnectionMode connectionMode, ClusterType type, java.util.List<ServerDescription> serverDescriptions)
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 clusterpublic boolean isCompatibleWithDriver()
public boolean hasReadableServer(ReadPreference readPreference)
readPreference - the non-null read preferencepublic boolean hasWritableServer()
public ClusterConnectionMode getConnectionMode()
public ClusterType getType()
public java.util.List<ServerDescription> getServerDescriptions()
@Deprecated public java.util.Set<ServerDescription> getAll()
getServerDescriptions() instead@Deprecated public ServerDescription getByServerAddress(ServerAddress serverAddress)
serverAddress - the ServerAddress for a server in this cluster@Deprecated public java.util.List<ServerDescription> getPrimaries()
@Deprecated public java.util.List<ServerDescription> getSecondaries()
@Deprecated public java.util.List<ServerDescription> getSecondaries(TagSet tagSet)
tagSet - a Set of replica set tags@Deprecated public java.util.List<ServerDescription> getAny()
@Deprecated public java.util.List<ServerDescription> getAnyPrimaryOrSecondary()
@Deprecated public java.util.List<ServerDescription> getAnyPrimaryOrSecondary(TagSet tagSet)
tagSet - a Set of replica set tagspublic boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.lang.String getShortDescription()