Package | Description |
---|---|
com.mongodb |
The core mongodb package
|
com.mongodb.binding |
This package contains classes that manage binding to MongoDB servers for various operations.
|
com.mongodb.connection |
Contains classes that manage connecting to MongoDB servers.
|
com.mongodb.selector |
Contains classes that determine how to select the server to connect to in order to send commands or queries.
|
Modifier and Type | Field and Description |
---|---|
private ServerSelector |
MongoClientOptions.serverSelector |
private ServerSelector |
MongoClientOptions.Builder.serverSelector |
Modifier and Type | Method and Description |
---|---|
ServerSelector |
MongoClientOptions.getServerSelector()
Gets the server selector.
|
private static ServerSelector |
Mongo.getServerSelector(MongoClientOptions options) |
Modifier and Type | Method and Description |
---|---|
MongoClientOptions.Builder |
MongoClientOptions.Builder.serverSelector(ServerSelector serverSelector)
Sets a server selector that augments the normal server selection rules applied by the driver when determining
which server to send an operation to.
|
Modifier and Type | Method and Description |
---|---|
private void |
AsyncClusterBinding.getAsyncClusterBindingConnectionSource(ServerSelector serverSelector,
SingleResultCallback<AsyncConnectionSource> callback) |
Constructor and Description |
---|
ClusterBindingConnectionSource(ServerSelector serverSelector) |
Modifier and Type | Field and Description |
---|---|
private ServerSelector |
BaseCluster.ServerSelectionRequest.compositeSelector |
private ServerSelector |
BaseCluster.ServerSelectionRequest.originalSelector |
private ServerSelector |
ClusterSettings.serverSelector |
private ServerSelector |
ClusterSettings.Builder.serverSelector |
Modifier and Type | Method and Description |
---|---|
private ServerSelector |
BaseCluster.getCompositeServerSelector(ServerSelector serverSelector) |
ServerSelector |
ClusterSettings.getServerSelector()
Gets the
ServerSelector that will be uses as the final server selector that is applied in calls to Cluster.selectServer . |
Modifier and Type | Method and Description |
---|---|
private MongoTimeoutException |
BaseCluster.createTimeoutException(ServerSelector serverSelector,
ClusterDescription curDescription) |
private ServerSelector |
BaseCluster.getCompositeServerSelector(ServerSelector serverSelector) |
private void |
BaseCluster.logServerSelectionFailure(ServerSelector serverSelector,
ClusterDescription curDescription) |
private Server |
BaseCluster.selectRandomServer(ServerSelector serverSelector,
ClusterDescription clusterDescription) |
Server |
Cluster.selectServer(ServerSelector serverSelector)
Get a MongoDB server that matches the criteria defined by the serverSelector
|
Server |
BaseCluster.selectServer(ServerSelector serverSelector) |
void |
Cluster.selectServerAsync(ServerSelector serverSelector,
SingleResultCallback<Server> callback)
Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.
|
void |
BaseCluster.selectServerAsync(ServerSelector serverSelector,
SingleResultCallback<Server> callback) |
ClusterSettings.Builder |
ClusterSettings.Builder.serverSelector(ServerSelector serverSelector)
Sets the final server selector for the cluster to apply before selecting a server
|
Constructor and Description |
---|
ServerSelectionRequest(ServerSelector serverSelector,
ServerSelector compositeSelector,
long maxWaitTimeNanos,
SingleResultCallback<Server> callback) |
Modifier and Type | Class and Description |
---|---|
class |
CompositeServerSelector
A server selector that composes a list of server selectors, and selects the servers by iterating through the list from start to
finish, passing the result of the previous into the next, and finally returning the result of the last one.
|
class |
LatencyMinimizingServerSelector
A server selector that accepts only servers within the given ping-time latency difference from the faster of the servers.
|
class |
PrimaryServerSelector
Deprecated.
Use either
ReadPreferenceServerSelector or WritableServerSelector , depending on your requirements |
class |
ReadPreferenceServerSelector
A server selector that chooses based on a read preference.
|
class |
ServerAddressSelector
A server selector that chooses a server that matches the server address.
|
class |
WritableServerSelector
A server selector that chooses servers that are writable.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<ServerSelector> |
CompositeServerSelector.serverSelectors |
Constructor and Description |
---|
CompositeServerSelector(java.util.List<? extends ServerSelector> serverSelectors)
Constructs a new instance.
|