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.
|
ClusterStats |
getClusterStats()
Returns the meta-data on the current cluster.
|
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.
|
void |
send(Message message1,
Message message2,
ReplyCallback replyCallback)
Sends a message on the connection.
|
void |
send(Message message,
ReplyCallback replyCallback)
Sends a message on the connection.
|
static final int MAX_DOCUMENT_SIZE
void close()
ClusterStats getClusterStats()
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.void send(Message message1, Message message2, ReplyCallback 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.void send(Message message, ReplyCallback 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.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.