Package com.mongodb.connection
Class ServerDescription
java.lang.Object
com.mongodb.connection.ServerDescription
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Immutable snapshot state of a server.
- Since:
- 3.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated.Usage of this API is not supported in AEM as a Cloud Service. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Deprecated.The maximum supported driver wire versionstatic final String
Deprecated.The minimum supported driver server versionstatic final int
Deprecated.The minimum supported driver wire version -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerDescription.Builder
builder()
Deprecated.Gets a Builder for creating a new ServerDescription instance.boolean
Deprecated.Returns true if this instance is equals to @code{o}.Deprecated.Gets the address of this serverDeprecated.Gets the arbiters in the replica setDeprecated.Gets the string representing the host name and port that this member of a replica set was configured with, e.g.Deprecated.Gets the type of the cluster this server is in (for example, replica set).static int
Deprecated.Get the default maximum document size.static int
Deprecated.Get the default maximum wire versionstatic int
Deprecated.Get the default minimum wire versionDeprecated.The replica set electionid reported by this MongoDB server.Deprecated.Gets the exception thrown while attempting to determine the server description.getHosts()
Deprecated.Get a Set of strings in the format of "[hostname]:[port]" that contains all members of the replica set that are neither hidden, passive, nor arbiters.long
getLastUpdateTime
(TimeUnit timeUnit) Deprecated.Gets the time that this server description was created, using a monotonic clock likeSystem.nanoTime()
.Deprecated.Gets the last write date.Deprecated.Gets the session timeout in minutes.int
Deprecated.The maximum permitted size of a BSON object in bytes for this mongod process.int
Deprecated.The latest version of the wire protocol that this MongoDB server is capable of using to communicate with clients.int
Deprecated.The earliest version of the wire protocol that this MongoDB server is capable of using to communicate with clients.Deprecated.Gets the passive members of the replica set.Deprecated.Gets the address of the current primary in the replica setlong
Deprecated.Get the time it took to make the round trip for requesting this information from the server in nanoseconds.Deprecated.Gets the name of the replica setDeprecated.The replica set setVersion reported by this MongoDB server.Deprecated.Returns a short, pretty description for this ServerDescription.getState()
Deprecated.Gets the current state of the connection to the server.Deprecated.A set of all tags assigned to this member.getType()
Deprecated.Gets the type of the server, for example whether it's a standalone or in a replica set.Deprecated.UsegetMaxWireVersion()
insteadint
hashCode()
Deprecated.boolean
Deprecated.Returns true if the server has the given tags.boolean
Deprecated.Return whether the server is compatible with the driver.boolean
Deprecated.Return whether the server is compatible with the driver.boolean
Deprecated.Return whether the server is compatible with the driver.boolean
isOk()
Deprecated.The isOK() result from requesting this information from the serverboolean
Deprecated.Returns whether this can be treated as a primary server.boolean
Deprecated.Gets whether this server is a replica set member.boolean
Deprecated.Returns whether this can be treated as a secondary server.boolean
Deprecated.Gets whether this is a server that is the entry point to a sharded instance of MongoDB.boolean
Deprecated.Gets whether this is part of a replica set/sharded system, or is a single server.toString()
Deprecated.
-
Field Details
-
MIN_DRIVER_SERVER_VERSION
Deprecated.The minimum supported driver server version- Since:
- 3.8
- See Also:
-
MIN_DRIVER_WIRE_VERSION
public static final int MIN_DRIVER_WIRE_VERSIONDeprecated.The minimum supported driver wire version- Since:
- 3.8
- See Also:
-
MAX_DRIVER_WIRE_VERSION
public static final int MAX_DRIVER_WIRE_VERSIONDeprecated.The maximum supported driver wire version- Since:
- 3.8
- See Also:
-
-
Method Details
-
builder
Deprecated.Gets a Builder for creating a new ServerDescription instance.- Returns:
- a new Builder for ServerDescription.
-
getCanonicalAddress
Deprecated.Gets the string representing the host name and port that this member of a replica set was configured with, e.g."somehost:27019"
. This is typically derived from the "me" field from the "isMaster" command response.- Returns:
- the host name and port that this replica set member is configured with.
-
getLogicalSessionTimeoutMinutes
Deprecated.Gets the session timeout in minutes.- Returns:
- the session timeout in minutes, or null if sessions are not supported by this server
- Since:
- 3.6
-
isCompatibleWithDriver
public boolean isCompatibleWithDriver()Deprecated.Return whether the server is compatible with the driver. An incompatible server is one that has a min wire version greater that the driver's max wire version or a max wire version less than the driver's min wire version.- Returns:
- true if the server is compatible with the driver.
-
isIncompatiblyNewerThanDriver
public boolean isIncompatiblyNewerThanDriver()Deprecated.Return whether the server is compatible with the driver. An incompatible server is one that has a min wire version greater that the driver's max wire version or a max wire version less than the driver's min wire version.- Returns:
- true if the server is compatible with the driver.
- Since:
- 3.6
-
isIncompatiblyOlderThanDriver
public boolean isIncompatiblyOlderThanDriver()Deprecated.Return whether the server is compatible with the driver. An incompatible server is one that has a min wire version greater that the driver's max wire version or a max wire version less than the driver's min wire version.- Returns:
- true if the server is compatible with the driver.
- Since:
- 3.6
-
getDefaultMaxDocumentSize
public static int getDefaultMaxDocumentSize()Deprecated.Get the default maximum document size.- Returns:
- the default maximum document size
-
getDefaultMinWireVersion
public static int getDefaultMinWireVersion()Deprecated.Get the default minimum wire version- Returns:
- the default minimum wire version
-
getDefaultMaxWireVersion
public static int getDefaultMaxWireVersion()Deprecated.Get the default maximum wire version- Returns:
- the default maximum wire version
-
getAddress
Deprecated.Gets the address of this server- Returns:
- a ServerAddress containing the details of the address of this server.
-
isReplicaSetMember
public boolean isReplicaSetMember()Deprecated.Gets whether this server is a replica set member.- Returns:
- true if this server is part of a replica set
-
isShardRouter
public boolean isShardRouter()Deprecated.Gets whether this is a server that is the entry point to a sharded instance of MongoDB.- Returns:
- true if this server is a mongos instance
-
isStandAlone
public boolean isStandAlone()Deprecated.Gets whether this is part of a replica set/sharded system, or is a single server.- Returns:
- true if this is a single server
-
isPrimary
public boolean isPrimary()Deprecated.Returns whether this can be treated as a primary server.- Returns:
- true if this server is the primary in a replica set, is a mongos, or is a single standalone server
-
isSecondary
public boolean isSecondary()Deprecated.Returns whether this can be treated as a secondary server.- Returns:
- true if this server is a secondary in a replica set, is a mongos, or is a single standalone server
-
getHosts
Deprecated.Get a Set of strings in the format of "[hostname]:[port]" that contains all members of the replica set that are neither hidden, passive, nor arbiters.- Returns:
- all members of the replica set that are neither hidden, passive, nor arbiters.
-
getPassives
Deprecated.Gets the passive members of the replica set.- Returns:
- A set of strings in the format of "[hostname]:[port]" listing all members of the replica set which have a priority of 0.
-
getArbiters
Deprecated.Gets the arbiters in the replica set- Returns:
- A Set of strings in the format of "[hostname]:[port]" containing all members of the replica set that are arbiters.
-
getPrimary
Deprecated.Gets the address of the current primary in the replica set- Returns:
- A string in the format of "[hostname]:[port]" listing the current primary member of the replica set.
-
getMaxDocumentSize
public int getMaxDocumentSize()Deprecated.The maximum permitted size of a BSON object in bytes for this mongod process. Defaults to 16MB.- Returns:
- the maximum size a document can be
-
getTagSet
Deprecated.A set of all tags assigned to this member.- Returns:
- a TagSet with all the tags for this server.
-
getMinWireVersion
public int getMinWireVersion()Deprecated.The earliest version of the wire protocol that this MongoDB server is capable of using to communicate with clients.- Returns:
- the minimum protocol version supported by this server
-
getMaxWireVersion
public int getMaxWireVersion()Deprecated.The latest version of the wire protocol that this MongoDB server is capable of using to communicate with clients.- Returns:
- the maximum protocol version supported by this server
-
getElectionId
Deprecated.The replica set electionid reported by this MongoDB server.- Returns:
- the electionId, which may be null
-
getSetVersion
Deprecated.The replica set setVersion reported by this MongoDB server.- Returns:
- the setVersion, which may be null
-
getLastWriteDate
Deprecated.Gets the last write date.- Returns:
- the last write date, which may be null
- Since:
- 3.4
-
getLastUpdateTime
Deprecated.Gets the time that this server description was created, using a monotonic clock likeSystem.nanoTime()
.- Parameters:
timeUnit
- the time unit- Returns:
- the last update time in the given unit
- Since:
- 3.4
-
hasTags
Deprecated.Returns true if the server has the given tags. A server of either typeServerType.STANDALONE
orServerType.SHARD_ROUTER
is considered to have all tags, so this method will always return true for instances of either of those types.- Parameters:
desiredTags
- the tags- Returns:
- true if this server has the given tags
-
getSetName
Deprecated.Gets the name of the replica set- Returns:
- the name of the replica set
-
isOk
public boolean isOk()Deprecated.The isOK() result from requesting this information from the server- Returns:
- true if the request executed correctly
-
getState
Deprecated.Gets the current state of the connection to the server.- Returns:
- ServerConnectionState representing whether the server has been successfully connected to
-
getType
Deprecated.Gets the type of the server, for example whether it's a standalone or in a replica set.- Returns:
- the server type
-
getClusterType
Deprecated.Gets the type of the cluster this server is in (for example, replica set).- Returns:
- a ClusterType representing the type of the cluster this server is in
-
getVersion
Deprecated.UsegetMaxWireVersion()
insteadGets the server version- Returns:
- a ServerVersion representing which version of MongoDB is running on this server
-
getRoundTripTimeNanos
public long getRoundTripTimeNanos()Deprecated.Get the time it took to make the round trip for requesting this information from the server in nanoseconds.- Returns:
- the time taken to request the information, in nano seconds
-
getException
Deprecated.Gets the exception thrown while attempting to determine the server description. This is useful for diagnostic purposed when determining the root cause of a connectivity failure.- Returns:
- the exception, which may be null
-
equals
Deprecated.Returns true if this instance is equals to @code{o}. Note that equality is defined to NOT include the round trip time. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated. -
getShortDescription
Deprecated.Returns a short, pretty description for this ServerDescription.- Returns:
- a String containing the most pertinent information about this ServerDescription
-