Package com.mongodb.connection
Enum Class ServerType
- All Implemented Interfaces:
Serializable
,Comparable<ServerType>
,java.lang.constant.Constable
The type of the server.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA replica set arbiter.A replica set member that does not report a set name or a hosts listA replica set member that is none of the other types (a passive, for example).A replica set primary.A replica set secondary.A router to a sharded cluster, i.e.A standalone mongod server.The server type is not yet known. -
Method Summary
Modifier and TypeMethodDescriptionabstract ClusterType
The type of the cluster to which this server belongsstatic ServerType
Returns the enum constant of this class with the specified name.static ServerType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STANDALONE
A standalone mongod server. -
REPLICA_SET_PRIMARY
A replica set primary. -
REPLICA_SET_SECONDARY
A replica set secondary. -
REPLICA_SET_ARBITER
A replica set arbiter. -
REPLICA_SET_OTHER
A replica set member that is none of the other types (a passive, for example). -
REPLICA_SET_GHOST
A replica set member that does not report a set name or a hosts list -
SHARD_ROUTER
A router to a sharded cluster, i.e. a mongos server. -
LOAD_BALANCER
-
UNKNOWN
The server type is not yet known.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getClusterType
The type of the cluster to which this server belongs- Returns:
- the cluster type
-