Package com.mongodb.binding
Class AsyncClusterBinding
- java.lang.Object
-
- com.mongodb.binding.AsyncClusterBinding
-
- All Implemented Interfaces:
AsyncReadBinding,AsyncReadWriteBinding,AsyncWriteBinding,ReferenceCounted
Deprecated.
@Deprecated public class AsyncClusterBinding extends Object implements AsyncReadWriteBinding
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
Constructors Constructor Description AsyncClusterBinding(Cluster cluster, ReadPreference readPreference)Deprecated.AsyncClusterBinding(Cluster cluster, ReadPreference readPreference, ReadConcern readConcern)Deprecated.Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetCount()Gets the current reference count, which starts at 0.voidgetReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)Deprecated.Returns a connection source to a server that satisfies the specified read preference.ReadPreferencegetReadPreference()Deprecated.The read preference that all connection sources returned by this instance will satisfy.SessionContextgetSessionContext()Deprecated.Gets the session context for this binding.voidgetWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)Deprecated.Supply a connection source to a server that can be written tovoidrelease()Release a reference to this object.AsyncReadWriteBindingretain()Deprecated.Retain an additional reference to this object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.binding.ReferenceCounted
getCount, release
-
-
-
-
Constructor Detail
-
AsyncClusterBinding
@Deprecated public AsyncClusterBinding(Cluster cluster, ReadPreference readPreference)
Deprecated. PreferAsyncClusterBinding(Cluster, ReadPreference, ReadConcern)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
-
AsyncClusterBinding
public AsyncClusterBinding(Cluster cluster, ReadPreference readPreference, ReadConcern readConcern)
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 Detail
-
retain
public AsyncReadWriteBinding 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 interfaceAsyncReadBinding- Specified by:
retainin interfaceAsyncReadWriteBinding- Specified by:
retainin interfaceAsyncWriteBinding- Specified by:
retainin interfaceReferenceCounted- Returns:
- this
-
getReadPreference
public ReadPreference getReadPreference()
Deprecated.Description copied from interface:AsyncReadBindingThe read preference that all connection sources returned by this instance will satisfy.- Specified by:
getReadPreferencein interfaceAsyncReadBinding- Returns:
- the non-null read preference
-
getSessionContext
public SessionContext getSessionContext()
Deprecated.Description copied from interface:AsyncReadBindingGets the session context for this binding.- Specified by:
getSessionContextin interfaceAsyncReadBinding- Specified by:
getSessionContextin interfaceAsyncWriteBinding- Returns:
- the session context, which may not be null
-
getReadConnectionSource
public void getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Description copied from interface:AsyncReadBindingReturns a connection source to a server that satisfies the specified read preference.- Specified by:
getReadConnectionSourcein interfaceAsyncReadBinding- Parameters:
callback- the to be passed the connection source
-
getWriteConnectionSource
public void getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Description copied from interface:AsyncWriteBindingSupply a connection source to a server that can be written to- Specified by:
getWriteConnectionSourcein interfaceAsyncWriteBinding- Parameters:
callback- the to be passed the connection source
-
getCount
public int getCount()
Description copied from interface:ReferenceCountedGets the current reference count, which starts at 0.- Specified by:
getCountin interfaceReferenceCounted- Returns:
- the current count, which must be greater than or equal to 0
-
release
public void release()
Description copied from interface:ReferenceCountedRelease a reference to this object.- Specified by:
releasein interfaceReferenceCounted
-
-