Package com.mongodb.binding
Class SingleServerBinding
java.lang.Object
com.mongodb.internal.binding.AbstractReferenceCounted
com.mongodb.binding.SingleServerBinding
- All Implemented Interfaces:
ReadBinding
,ReadWriteBinding
,ReferenceCounted
,WriteBinding
@Deprecated
public class SingleServerBinding
extends com.mongodb.internal.binding.AbstractReferenceCounted
implements ReadWriteBinding
Deprecated.
A simple binding where all connection sources are bound to the server specified in the constructor.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionSingleServerBinding
(Cluster cluster, ServerAddress serverAddress) Deprecated.Creates an instance, defaulting toReadPreference.primary()
for reads.SingleServerBinding
(Cluster cluster, ServerAddress serverAddress, ReadPreference readPreference) Deprecated.Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.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, 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 Details
-
SingleServerBinding
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
-
SingleServerBinding
public SingleServerBinding(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
-
getWriteConnectionSource
Deprecated.Description copied from interface:WriteBinding
Supply a connection source to a server that can be written to- Specified by:
getWriteConnectionSource
in interfaceWriteBinding
- Returns:
- a connection source
-
getReadPreference
Deprecated.Description copied from interface:ReadBinding
The read preference that all connection sources returned by this instance will satisfy.- Specified by:
getReadPreference
in interfaceReadBinding
- Returns:
- the non-null read preference
-
getReadConnectionSource
Deprecated.Description copied from interface:ReadBinding
Returns a connection source to a server that satisfies the specified read preference.- Specified by:
getReadConnectionSource
in interfaceReadBinding
- Returns:
- the connection source
-
getSessionContext
Deprecated.Description copied from interface:ReadBinding
Gets the session context for this binding.- Specified by:
getSessionContext
in interfaceReadBinding
- Specified by:
getSessionContext
in interfaceWriteBinding
- Returns:
- the session context, which may not be null
-
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 interfaceReadBinding
- Specified by:
retain
in interfaceReadWriteBinding
- Specified by:
retain
in interfaceReferenceCounted
- Specified by:
retain
in interfaceWriteBinding
- Overrides:
retain
in classcom.mongodb.internal.binding.AbstractReferenceCounted
- Returns:
- this
-