ReadBinding
, ReadWriteBinding
, ReferenceCounted
, WriteBinding
public class ClusterBinding extends Object implements ReadWriteBinding
Constructor | Description |
---|---|
ClusterBindingโ(Cluster cluster,
ReadPreference readPreference) |
Creates an instance.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getCountโ() |
Gets the current reference count, which starts at 0.
|
ConnectionSource |
getReadConnectionSourceโ() |
Returns a connection source to a server that satisfies the specified read preference.
|
ReadPreference |
getReadPreferenceโ() |
The read preference that all connection sources returned by this instance will satisfy.
|
SessionContext |
getSessionContextโ() |
Gets the session context for this binding.
|
ConnectionSource |
getWriteConnectionSourceโ() |
Supply a connection source to a server that can be written to
|
void |
releaseโ() |
Release a reference to this object.
|
ReadWriteBinding |
retainโ() |
Retain an additional reference to this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCount, release
public ClusterBindingโ(Cluster cluster, ReadPreference readPreference)
cluster
- a non-null Cluster which will be used to select a server to bind toreadPreference
- a non-null ReadPreference for read operationspublic ReadWriteBinding retainโ()
ReferenceCounted
retain
in interface ReadBinding
retain
in interface ReadWriteBinding
retain
in interface ReferenceCounted
retain
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 ConnectionSource getWriteConnectionSourceโ()
WriteBinding
getWriteConnectionSource
in interface WriteBinding
public int getCountโ()
ReferenceCounted
getCount
in interface ReferenceCounted
public void releaseโ()
ReferenceCounted
release
in interface ReferenceCounted