public interface Client
Modifier and Type | Field and Description |
---|---|
static int |
MAX_DOCUMENT_SIZE
The absolute maximum size for a BSON document supported by all versions
of MongoDB servers: 16MiB (16777216 ).
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the client.
|
ClusterType |
getClusterType()
Returns the type of cluster the client is connected to.
|
MongoClientConfiguration |
getConfig()
Returns the configuration being used by the logical MongoDB connection.
|
Durability |
getDefaultDurability()
Returns the
Durability from the MongoClientConfiguration . |
ReadPreference |
getDefaultReadPreference()
Returns the
ReadPreference from the
MongoClientConfiguration . |
MongoIterator<Document> |
restart(DocumentAssignable cursorDocument)
Restarts an iterator that was previously saved.
|
MongoCursorControl |
restart(StreamCallback<Document> results,
DocumentAssignable cursorDocument)
Restarts a document stream from a cursor that was previously saved.
|
String |
send(Message message,
Callback<Reply> replyCallback)
Sends a message on the connection.
|
String |
send(Message message1,
Message message2,
Callback<Reply> replyCallback)
Sends a message on the connection.
|
static final int MAX_DOCUMENT_SIZE
void close()
ClusterType getClusterType()
MongoClientConfiguration getConfig()
Durability getDefaultDurability()
Durability
from the MongoClientConfiguration
.MongoClientConfiguration
.ReadPreference getDefaultReadPreference()
ReadPreference
from the
MongoClientConfiguration
.MongoClientConfiguration
.MongoIterator<Document> restart(DocumentAssignable cursorDocument) throws IllegalArgumentException
cursorDocument
- The document containing the state of the cursor.IllegalArgumentException
- If the document does not contain a valid cursor state.MongoCursorControl restart(StreamCallback<Document> results, DocumentAssignable cursorDocument) throws IllegalArgumentException
results
- Callback that will be notified of the results of the cursor.cursorDocument
- The document containing the state of the cursor.MongoCursorControl
to control the cursor streaming
documents to the caller. This includes the ability to stop the
cursor and persist its state.IllegalArgumentException
- If the document does not contain a valid cursor state.String send(Message message, Callback<Reply> replyCallback) throws MongoDbException
message
- The message to send on the connection.replyCallback
- The callback to notify of responses to the messages. May be
null
.MongoDbException
- On an error sending the message.String send(Message message1, Message message2, Callback<Reply> replyCallback) throws MongoDbException
message1
- The first message to send on the connection.message2
- The second message to send on the connection.replyCallback
- The callback to notify of responses to the message2
.
May be null
.MongoDbException
- On an error sending the message.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.