@Deprecated public class SingleServerBinding extends com.mongodb.internal.binding.AbstractReferenceCounted implements ReadWriteBinding
Constructor and Description |
---|
SingleServerBinding(Cluster cluster,
ServerAddress serverAddress)
Deprecated.
Creates an instance, defaulting to
ReadPreference.primary() for reads. |
SingleServerBinding(Cluster cluster,
ServerAddress serverAddress,
ReadPreference readPreference)
Deprecated.
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
ConnectionSource |
getReadConnectionSource()
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.
|
ConnectionSource |
getWriteConnectionSource()
Deprecated.
Supply a connection source to a server that can be written to
|
SingleServerBinding |
retain()
Deprecated.
Retain an additional reference to this object.
|
getCount, release
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCount, release
public SingleServerBinding(Cluster cluster, ServerAddress serverAddress)
ReadPreference.primary()
for reads.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 topublic SingleServerBinding(Cluster cluster, ServerAddress serverAddress, ReadPreference readPreference)
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 operationspublic ConnectionSource getWriteConnectionSource()
WriteBinding
getWriteConnectionSource
in interface WriteBinding
public ReadPreference getReadPreference()
ReadBinding
getReadPreference
in interface ReadBinding
public ConnectionSource getReadConnectionSource()
ReadBinding
getReadConnectionSource
in interface ReadBinding
public SessionContext getSessionContext()
ReadBinding
getSessionContext
in interface ReadBinding
getSessionContext
in interface WriteBinding
public SingleServerBinding retain()
ReferenceCounted
retain
in interface ReadBinding
retain
in interface ReadWriteBinding
retain
in interface ReferenceCounted
retain
in interface WriteBinding
retain
in class com.mongodb.internal.binding.AbstractReferenceCounted
Copyright © 2010 - 2023 Adobe. All Rights Reserved