@Immutable class ServerDescription extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ServerDescription.Builder |
| Modifier and Type | Field and Description |
|---|---|
private ServerAddress |
address |
private java.util.Set<java.lang.String> |
arbiters |
private long |
averageLatencyNanos |
private java.lang.String |
canonicalAddress |
private static int |
DEFAULT_MAX_DOCUMENT_SIZE |
private static int |
DEFAULT_MAX_MESSAGE_SIZE |
private static int |
DEFAULT_MAX_WRITE_BATCH_SIZE |
private ObjectId |
electionId |
private java.lang.Throwable |
exception |
private java.util.Set<java.lang.String> |
hosts |
(package private) static int |
MAX_DRIVER_WIRE_VERSION |
private int |
maxDocumentSize |
private int |
maxMessageSize |
private int |
maxWireVersion |
private int |
maxWriteBatchSize |
(package private) static int |
MIN_DRIVER_WIRE_VERSION |
private int |
minWireVersion |
private boolean |
ok |
private java.util.Set<java.lang.String> |
passives |
private java.lang.String |
primary |
private java.lang.String |
setName |
private java.lang.Integer |
setVersion |
private ServerConnectionState |
state |
private TagSet |
tagSet |
private ServerType |
type |
private ServerVersion |
version |
| Constructor and Description |
|---|
ServerDescription(ServerDescription.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
static ServerDescription.Builder |
builder() |
boolean |
equals(java.lang.Object o)
Returns true if this instance is equals to @code{o}.
|
ServerAddress |
getAddress() |
java.util.Set<java.lang.String> |
getArbiters() |
private java.lang.String |
getAverageLatencyFormattedInMilliseconds() |
long |
getAverageLatencyNanos() |
java.lang.String |
getCanonicalAddress()
Gets the string representing the host name and port that this member of a replica set was configured with,
e.g.
|
ClusterType |
getClusterType() |
static int |
getDefaultMaxDocumentSize() |
static int |
getDefaultMaxMessageSize() |
static int |
getDefaultMaxWireVersion() |
static int |
getDefaultMaxWriteBatchSize() |
static int |
getDefaultMinWireVersion() |
ObjectId |
getElectionId()
The replica set electionid reported by this MongoDB server.
|
java.lang.Throwable |
getException() |
java.util.Set<java.lang.String> |
getHosts() |
int |
getMaxDocumentSize() |
int |
getMaxMessageSize() |
int |
getMaxWireVersion() |
int |
getMaxWriteBatchSize() |
int |
getMinWireVersion() |
java.util.Set<java.lang.String> |
getPassives() |
java.lang.String |
getPrimary() |
java.lang.String |
getSetName() |
java.lang.Integer |
getSetVersion()
The replica set setVersion reported by this MongoDB server.
|
java.lang.String |
getShortDescription() |
ServerConnectionState |
getState() |
TagSet |
getTagSet() |
ServerType |
getType() |
ServerVersion |
getVersion() |
int |
hashCode() |
boolean |
hasTags(TagSet desiredTags)
Returns true if the server has the given tags.
|
boolean |
isCompatibleWithDriver()
Return whether the server is compatible with the driver.
|
boolean |
isOk() |
boolean |
isPrimary() |
boolean |
isReplicaSetMember() |
boolean |
isSecondary() |
boolean |
isShardRouter() |
boolean |
isStandAlone() |
java.lang.String |
toString() |
private java.lang.String |
translateExceptionToString() |
static final int MIN_DRIVER_WIRE_VERSION
static final int MAX_DRIVER_WIRE_VERSION
private static final int DEFAULT_MAX_DOCUMENT_SIZE
private static final int DEFAULT_MAX_MESSAGE_SIZE
private static final int DEFAULT_MAX_WRITE_BATCH_SIZE
private final ServerAddress address
private final ServerType type
private final java.lang.String canonicalAddress
private final java.util.Set<java.lang.String> hosts
private final java.util.Set<java.lang.String> passives
private final java.util.Set<java.lang.String> arbiters
private final java.lang.String primary
private final int maxDocumentSize
private final int maxWriteBatchSize
private final int maxMessageSize
private final TagSet tagSet
private final java.lang.String setName
private final long averageLatencyNanos
private final boolean ok
private final ServerConnectionState state
private final ServerVersion version
private final int minWireVersion
private final int maxWireVersion
private final ObjectId electionId
private final java.lang.Integer setVersion
private final java.lang.Throwable exception
ServerDescription(ServerDescription.Builder builder)
public boolean isCompatibleWithDriver()
public static int getDefaultMaxDocumentSize()
public static int getDefaultMaxMessageSize()
public static int getDefaultMinWireVersion()
public static int getDefaultMaxWireVersion()
public static int getDefaultMaxWriteBatchSize()
public static ServerDescription.Builder builder()
public ServerAddress getAddress()
public boolean isReplicaSetMember()
public boolean isShardRouter()
public boolean isStandAlone()
public boolean isPrimary()
public boolean isSecondary()
public java.lang.String getCanonicalAddress()
"somehost:27019". This is typically derived from the "me" field from the "isMaster" command response.public java.util.Set<java.lang.String> getHosts()
public java.util.Set<java.lang.String> getPassives()
public java.util.Set<java.lang.String> getArbiters()
public java.lang.String getPrimary()
public int getMaxDocumentSize()
public int getMaxMessageSize()
public int getMaxWriteBatchSize()
public TagSet getTagSet()
public int getMinWireVersion()
public int getMaxWireVersion()
public ObjectId getElectionId()
public java.lang.Integer getSetVersion()
public boolean hasTags(TagSet desiredTags)
ServerType.StandAlone or
ServerType.ShardRouter is considered to have all tags, so this method will always return true for instances of either of
those types.desiredTags - the tagspublic java.lang.String getSetName()
public boolean isOk()
public ServerConnectionState getState()
public ServerType getType()
public ClusterType getClusterType()
public ServerVersion getVersion()
public long getAverageLatencyNanos()
public java.lang.Throwable getException()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to compare topublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getShortDescription()
private java.lang.String translateExceptionToString()
private java.lang.String getAverageLatencyFormattedInMilliseconds()