Package | Description |
---|---|
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 | Method and Description |
---|---|
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 |
---|---|
Server |
Cluster.selectServer(ServerSelector serverSelector)
Get a MongoDB server that matches the criteria defined by the serverSelector
|
void |
Cluster.selectServerAsync(ServerSelector serverSelector,
SingleResultCallback<Server> callback)
Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.
|
ClusterSettings.Builder |
ClusterSettings.Builder.serverSelector(ServerSelector serverSelector)
Sets the final server selector for the cluster to apply before selecting a server
|
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.
|
Constructor and Description |
---|
CompositeServerSelector(List<? extends ServerSelector> serverSelectors)
Constructs a new instance.
|
Copyright © 2016. All Rights Reserved.