Search in sources :

Example 1 with ReadWriteBinding

use of com.mongodb.internal.binding.ReadWriteBinding in project mongo-java-driver by mongodb.

the class ClusterFixture method getBinding.

private static ReadWriteBinding getBinding(final Cluster cluster, final ReadPreference readPreference) {
    if (!bindingMap.containsKey(readPreference)) {
        ReadWriteBinding binding = new ClusterBinding(cluster, readPreference, ReadConcern.DEFAULT, getServerApi(), IgnorableRequestContext.INSTANCE);
        if (serverVersionAtLeast(3, 6)) {
            binding = new SessionBinding(binding);
        }
        bindingMap.put(readPreference, binding);
    }
    return bindingMap.get(readPreference);
}
Also used : AsyncReadWriteBinding(com.mongodb.internal.binding.AsyncReadWriteBinding) ReadWriteBinding(com.mongodb.internal.binding.ReadWriteBinding) ClusterBinding(com.mongodb.internal.binding.ClusterBinding) AsyncClusterBinding(com.mongodb.internal.binding.AsyncClusterBinding) AsyncSessionBinding(com.mongodb.internal.binding.AsyncSessionBinding) SessionBinding(com.mongodb.internal.binding.SessionBinding)

Aggregations

AsyncClusterBinding (com.mongodb.internal.binding.AsyncClusterBinding)1 AsyncReadWriteBinding (com.mongodb.internal.binding.AsyncReadWriteBinding)1 AsyncSessionBinding (com.mongodb.internal.binding.AsyncSessionBinding)1 ClusterBinding (com.mongodb.internal.binding.ClusterBinding)1 ReadWriteBinding (com.mongodb.internal.binding.ReadWriteBinding)1 SessionBinding (com.mongodb.internal.binding.SessionBinding)1