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
ConstructorsConstructorDescriptionAsyncSingleServerBinding(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
Modifier and TypeMethodDescriptionvoidDeprecated.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.voidDeprecated.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
-
AsyncSingleServerBinding
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 Details
-
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
-
getReadConnectionSource
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
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
-
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
-
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- Overrides:
retainin classcom.mongodb.internal.binding.AbstractReferenceCounted- Returns:
- this
-