public class GetMore extends AbstractMessage
struct {
MsgHeader header; // standard message header
int32 ZERO; // 0 - reserved for future use
cstring fullCollectionName; // "dbname.collectionname"
int32 numberToReturn; // number of documents to return
int64 cursorID; // cursorID from the OP_REPLY
}
HEADER_SIZE, myCollectionName, myDatabaseName
Constructor and Description |
---|
GetMore(BsonInputStream in)
Creates a new GetMore.
|
GetMore(String databaseName,
String collectionName,
long cursorId,
int numberToReturn,
ReadPreference readPreference)
Creates a new GetMore.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Determines if the passed object is of this same type as this object and
if so that its fields are equal.
|
long |
getCursorId()
Returns the id of the cursor to get more documents from.
|
int |
getNumberToReturn()
Return the number of documents to return from the cursor.
|
String |
getOperationName()
Returns a short name for the operation.
|
int |
hashCode()
Computes a reasonable hash code.
|
int |
size()
Returns the total size of the message on the wire.
|
void |
validateSize(int maxDocumentSize)
Validates that the documents with the message do not exceed the maximum
document size specified.
|
void |
write(int messageId,
BsonOutputStream out)
Writes the message from the stream.
|
void |
write(int messageId,
BufferingBsonOutputStream out)
Writes the message from the stream.
|
finishHeader, getCollectionName, getDatabaseName, getReadPreference, getRequiredVersionRange, init, writeHeader, writeHeader
public GetMore(BsonInputStream in) throws IOException
in
- The stream to read the get_more message from.IOException
- On a failure reading the get_more message.public GetMore(String databaseName, String collectionName, long cursorId, int numberToReturn, ReadPreference readPreference)
databaseName
- The name of the database.collectionName
- The name of the collection.cursorId
- The id of the cursor.numberToReturn
- The number of documents to return.readPreference
- The preferences for which server to send the request.public boolean equals(Object object)
equals
in class AbstractMessage
object
- The object to compare to.Object.equals(java.lang.Object)
public long getCursorId()
public int getNumberToReturn()
public String getOperationName()
Overridden to return the name of the operation: "GET_MORE".
public int hashCode()
hashCode
in class AbstractMessage
public int size()
Overridden to return the size of the GetMore
.
public void validateSize(int maxDocumentSize) throws DocumentToLargeException
Overrridden to be a no-op since the size of a GetMore is fixed.
maxDocumentSize
- The maximum document size to validate against.DocumentToLargeException
- If one of the documents in the message is too large or the
documents in aggregate are too large.public void write(int messageId, BsonOutputStream out) throws IOException
Overridden to write a get_more message.
messageId
- The id to be assigned to the message.out
- The sink for data written.IOException
- On an error writing to the stream.Message.write(int, BsonOutputStream)
public void write(int messageId, BufferingBsonOutputStream out) throws IOException
Overridden to write a get_more message.
messageId
- The id to be assigned to the message.out
- The sink for data written.IOException
- On an error writing to the stream.Message.write(int, BsonOutputStream)
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.