Package com.mongodb.binding
Class ClusterBinding
java.lang.Object
com.mongodb.internal.binding.AbstractReferenceCounted
com.mongodb.binding.ClusterBinding
- All Implemented Interfaces:
ReadBinding,ReadWriteBinding,ReferenceCounted,WriteBinding,com.mongodb.internal.binding.ClusterAwareReadWriteBinding
@Deprecated
public class ClusterBinding
extends com.mongodb.internal.binding.AbstractReferenceCounted
implements com.mongodb.internal.binding.ClusterAwareReadWriteBinding
Deprecated.
A simple ReadWriteBinding implementation that supplies write connection sources bound to a possibly different primary each time, and a
read connection source bound to a possible different server each time.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionClusterBinding(Cluster cluster, ReadPreference readPreference) Deprecated.ClusterBinding(Cluster cluster, ReadPreference readPreference, ReadConcern readConcern) Deprecated.Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Return the cluster.getConnectionSource(ServerAddress serverAddress) Deprecated.Deprecated.Returns a connection source to a server that satisfies the specified read preference.Deprecated.The read preference that all connection sources returned by this instance will satisfy.Deprecated.Gets the session context for this binding.Deprecated.Supply a connection source to a server that can be written toretain()Deprecated.Retain an additional reference to this object.Methods inherited from class com.mongodb.internal.binding.AbstractReferenceCounted
getCount, releaseMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mongodb.binding.ReferenceCounted
getCount, release
-
Constructor Details
-
ClusterBinding
Deprecated.Creates an instance.- Parameters:
cluster- a non-null Cluster which will be used to select a server to bind toreadPreference- a non-null ReadPreference for read operations
-
ClusterBinding
Deprecated.Creates an instance.- Parameters:
cluster- a non-null Cluster which will be used to select a server to bind toreadPreference- a non-null ReadPreference for read operationsreadConcern- a non-null read concern- Since:
- 3.8
-
-
Method Details
-
getCluster
Deprecated.Return the cluster.- Specified by:
getClusterin interfacecom.mongodb.internal.binding.ClusterAwareReadWriteBinding- Returns:
- the cluster
- Since:
- 3.11
-
retain
Deprecated.Description copied from interface:ReferenceCountedRetain an additional reference to this object. All retained references must be released, or there will be a leak.- Specified by:
retainin interfaceReadBinding- Specified by:
retainin interfaceReadWriteBinding- Specified by:
retainin interfaceReferenceCounted- Specified by:
retainin interfaceWriteBinding- Overrides:
retainin classcom.mongodb.internal.binding.AbstractReferenceCounted- Returns:
- this
-
getReadPreference
Deprecated.Description copied from interface:ReadBindingThe read preference that all connection sources returned by this instance will satisfy.- Specified by:
getReadPreferencein interfaceReadBinding- Returns:
- the non-null read preference
-
getSessionContext
Deprecated.Description copied from interface:ReadBindingGets the session context for this binding.- Specified by:
getSessionContextin interfaceReadBinding- Specified by:
getSessionContextin interfaceWriteBinding- Returns:
- the session context, which may not be null
-
getReadConnectionSource
Deprecated.Description copied from interface:ReadBindingReturns a connection source to a server that satisfies the specified read preference.- Specified by:
getReadConnectionSourcein interfaceReadBinding- Returns:
- the connection source
-
getWriteConnectionSource
Deprecated.Description copied from interface:WriteBindingSupply a connection source to a server that can be written to- Specified by:
getWriteConnectionSourcein interfaceWriteBinding- Returns:
- a connection source
-
getConnectionSource
Deprecated.- Specified by:
getConnectionSourcein interfacecom.mongodb.internal.binding.ClusterAwareReadWriteBinding
-
ClusterBinding(Cluster, ReadPreference, ReadConcern)