T - the type of document to decode query results toclass GetMoreProtocol<T> extends java.lang.Object implements Protocol<QueryResult<T>>
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
GetMoreProtocol.GetMoreResultCallback |
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
COMMAND_NAME |
private CommandListener |
commandListener |
private long |
cursorId |
static Logger |
LOGGER |
private MongoNamespace |
namespace |
private int |
numberToReturn |
private Decoder<T> |
resultDecoder |
| Constructor and Description |
|---|
GetMoreProtocol(MongoNamespace namespace,
long cursorId,
int numberToReturn,
Decoder<T> resultDecoder)
Construct an instance.
|
| Modifier and Type | Method and Description |
|---|---|
private BsonDocument |
asGetMoreCommandDocument() |
private BsonDocument |
asGetMoreCommandResponseDocument(QueryResult<T> queryResult,
ResponseBuffers responseBuffers) |
QueryResult<T> |
execute(InternalConnection connection)
Execute the protocol.
|
void |
executeAsync(InternalConnection connection,
SingleResultCallback<QueryResult<T>> callback)
Execute the protocol asynchronously.
|
private void |
sendMessage(GetMoreMessage message,
InternalConnection connection) |
void |
setCommandListener(CommandListener commandListener) |
public static final Logger LOGGER
private static final java.lang.String COMMAND_NAME
private final MongoNamespace namespace
private final long cursorId
private final int numberToReturn
private CommandListener commandListener
public GetMoreProtocol(MongoNamespace namespace, long cursorId, int numberToReturn, Decoder<T> resultDecoder)
namespace - the namespacecursorId - the cursor idnumberToReturn - the number of documents to returnresultDecoder - the decoder for the result documents.public QueryResult<T> execute(InternalConnection connection)
Protocolexecute in interface Protocol<QueryResult<T>>connection - the connection to execute the protocol onpublic void executeAsync(InternalConnection connection, SingleResultCallback<QueryResult<T>> callback)
ProtocolexecuteAsync in interface Protocol<QueryResult<T>>connection - the connection to execute the protocol oncallback - the callback that is passed the result of the executionpublic void setCommandListener(CommandListener commandListener)
setCommandListener in interface Protocol<QueryResult<T>>private void sendMessage(GetMoreMessage message, InternalConnection connection)
private BsonDocument asGetMoreCommandDocument()
private BsonDocument asGetMoreCommandResponseDocument(QueryResult<T> queryResult, ResponseBuffers responseBuffers)