Package com.mongodb.binding
Class AsyncSingleServerBinding
- java.lang.Object
-
- com.mongodb.internal.binding.AbstractReferenceCounted
-
- com.mongodb.binding.AsyncSingleServerBinding
-
- All Implemented Interfaces:
AsyncReadBinding
,AsyncReadWriteBinding
,AsyncWriteBinding
,ReferenceCounted
@Deprecated public class AsyncSingleServerBinding extends com.mongodb.internal.binding.AbstractReferenceCounted implements AsyncReadWriteBinding
Deprecated.A simple binding where all connection sources are bound to the server specified in the constructor.- Since:
- 3.11
-
-
Constructor Summary
Constructors Constructor Description AsyncSingleServerBinding(Cluster cluster, ServerAddress serverAddress)
Deprecated.Creates an instance, defaulting toReadPreference.primary()
for reads.AsyncSingleServerBinding(Cluster cluster, ServerAddress serverAddress, ReadPreference readPreference)
Deprecated.Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Returns a connection source to a server that satisfies the specified read preference.ReadPreference
getReadPreference()
Deprecated.The read preference that all connection sources returned by this instance will satisfy.SessionContext
getSessionContext()
Deprecated.Gets the session context for this binding.void
getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Supply a connection source to a server that can be written toAsyncSingleServerBinding
retain()
Deprecated.Retain an additional reference to this object.-
Methods inherited from class com.mongodb.internal.binding.AbstractReferenceCounted
getCount, release
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.binding.ReferenceCounted
getCount, release
-
-
-
-
Constructor Detail
-
AsyncSingleServerBinding
public AsyncSingleServerBinding(Cluster cluster, ServerAddress serverAddress)
Deprecated.Creates an instance, defaulting toReadPreference.primary()
for reads.- Parameters:
cluster
- a non-null Cluster which will be used to select a server to bind toserverAddress
- a non-null address of the server to bind to
-
AsyncSingleServerBinding
public AsyncSingleServerBinding(Cluster cluster, ServerAddress serverAddress, ReadPreference readPreference)
Deprecated.Creates an instance.- Parameters:
cluster
- a non-null Cluster which will be used to select a server to bind toserverAddress
- a non-null address of the server to bind toreadPreference
- a non-null ReadPreference for read operations
-
-
Method Detail
-
getReadPreference
public ReadPreference getReadPreference()
Deprecated.Description copied from interface:AsyncReadBinding
The read preference that all connection sources returned by this instance will satisfy.- Specified by:
getReadPreference
in interfaceAsyncReadBinding
- Returns:
- the non-null read preference
-
getReadConnectionSource
public void getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Description copied from interface:AsyncReadBinding
Returns a connection source to a server that satisfies the specified read preference.- Specified by:
getReadConnectionSource
in interfaceAsyncReadBinding
- Parameters:
callback
- the to be passed the connection source
-
getWriteConnectionSource
public void getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Deprecated.Description copied from interface:AsyncWriteBinding
Supply a connection source to a server that can be written to- Specified by:
getWriteConnectionSource
in interfaceAsyncWriteBinding
- Parameters:
callback
- the to be passed the connection source
-
getSessionContext
public SessionContext getSessionContext()
Deprecated.Description copied from interface:AsyncReadBinding
Gets the session context for this binding.- Specified by:
getSessionContext
in interfaceAsyncReadBinding
- Specified by:
getSessionContext
in interfaceAsyncWriteBinding
- Returns:
- the session context, which may not be null
-
retain
public AsyncSingleServerBinding retain()
Deprecated.Description copied from interface:ReferenceCounted
Retain an additional reference to this object. All retained references must be released, or there will be a leak.- Specified by:
retain
in interfaceAsyncReadBinding
- Specified by:
retain
in interfaceAsyncReadWriteBinding
- Specified by:
retain
in interfaceAsyncWriteBinding
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classcom.mongodb.internal.binding.AbstractReferenceCounted
- Returns:
- this
-
-