public class AsyncClusterBinding extends AbstractReferenceCounted implements AsyncReadWriteBinding
| Modifier and Type | Class and Description |
|---|---|
private class |
AsyncClusterBinding.AsyncClusterBindingConnectionSource |
| Modifier and Type | Field and Description |
|---|---|
private Cluster |
cluster |
private ReadPreference |
readPreference |
| Constructor and Description |
|---|
AsyncClusterBinding(Cluster cluster,
ReadPreference readPreference)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
getAsyncClusterBindingConnectionSource(ServerSelector serverSelector,
SingleResultCallback<AsyncConnectionSource> callback) |
void |
getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
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.
|
void |
getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Supply a connection source to a server that can be written to
|
AsyncReadWriteBinding |
retain()
Retain an additional reference to this object.
|
getCount, releaseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCount, releaseprivate final Cluster cluster
private final ReadPreference readPreference
public AsyncClusterBinding(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 AsyncReadWriteBinding retain()
ReferenceCountedretain in interface AsyncReadBindingretain in interface AsyncReadWriteBindingretain in interface AsyncWriteBindingretain in interface ReferenceCountedretain in class AbstractReferenceCountedpublic ReadPreference getReadPreference()
AsyncReadBindinggetReadPreference in interface AsyncReadBindingpublic void getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
AsyncReadBindinggetReadConnectionSource in interface AsyncReadBindingcallback - the to be passed the connection sourcepublic void getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
AsyncWriteBindinggetWriteConnectionSource in interface AsyncWriteBindingcallback - the to be passed the connection sourceprivate void getAsyncClusterBindingConnectionSource(ServerSelector serverSelector, SingleResultCallback<AsyncConnectionSource> callback)