@Immutable public final class ClusterSettings extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ClusterSettings.Builder
A builder for the cluster settings.
|
Modifier and Type | Method and Description |
---|---|
static ClusterSettings.Builder |
builder()
Get a builder for this class.
|
static ClusterSettings.Builder |
builder(ClusterSettings clusterSettings)
Creates a builder instance.
|
boolean |
equals(Object o) |
List<ClusterListener> |
getClusterListeners()
Gets the cluster listeners.
|
String |
getDescription()
Gets the user defined description of the MongoClient.
|
List<ServerAddress> |
getHosts()
Gets the seed list of hosts for the cluster.
|
int |
getMaxWaitQueueSize()
This is the maximum number of threads that may be waiting for a connection to become available from the pool.
|
ClusterConnectionMode |
getMode()
Gets the mode.
|
ClusterType |
getRequiredClusterType()
Get
|
String |
getRequiredReplicaSetName()
Gets the required replica set name.
|
long |
getServerSelectionTimeout(TimeUnit timeUnit)
Gets the timeout to apply when selecting a server.
|
ServerSelector |
getServerSelector()
Gets the
ServerSelector that will be uses as the final server selector that is applied in calls to Cluster.selectServer . |
String |
getShortDescription()
Returns a short, pretty description for these ClusterSettings.
|
int |
hashCode() |
String |
toString() |
public static ClusterSettings.Builder builder()
public static ClusterSettings.Builder builder(ClusterSettings clusterSettings)
clusterSettings
- existing ClusterSettings to default the builder settings on.public String getDescription()
public List<ServerAddress> getHosts()
public ClusterConnectionMode getMode()
public ClusterType getRequiredClusterType()
public String getRequiredReplicaSetName()
public ServerSelector getServerSelector()
ServerSelector
that will be uses as the final server selector that is applied in calls to Cluster.selectServer
.Cluster.selectServer(com.mongodb.selector.ServerSelector)
public long getServerSelectionTimeout(TimeUnit timeUnit)
MongoTimeoutException
will be thrown. The default value is 30 seconds.
A value of 0 means that it will timeout immediately if no server is available. A negative value means to wait indefinitely.
timeUnit
- the time unitpublic int getMaxWaitQueueSize()
This is the maximum number of threads that may be waiting for a connection to become available from the pool. All further threads will get an exception immediately.
Default is 500.
public List<ClusterListener> getClusterListeners()
public String getShortDescription()