public class KillCursors extends AbstractMessage
struct {
MsgHeader header; // standard message header
int32 ZERO; // 0 - reserved for future use
int32 numberOfCursorIDs; // number of cursorIDs in message
int64* cursorIDs; // sequence of cursorIDs to close
}
HEADER_SIZE, myCollectionName, myDatabaseName
Constructor and Description |
---|
KillCursors(BsonInputStream in)
Creates a new KillCursors.
|
KillCursors(long[] cursorIds,
ReadPreference readPreference)
Creates a new KillCursors.
|
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[] |
getCursorIds()
Returns the ids of the cursors to be killed.
|
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 KillCursors(BsonInputStream in) throws IOException
in
- The stream to read the kill_cursors message from.IOException
- On a failure reading the kill_cursors message.public KillCursors(long[] cursorIds, ReadPreference readPreference)
cursorIds
- The ids of the cursors to kill.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[] getCursorIds()
public String getOperationName()
Overridden to return the name of the operation: "KILL_CURSORS".
public int hashCode()
hashCode
in class AbstractMessage
public int size()
Overridden to return the size of the KillCursors
.
public void validateSize(int maxDocumentSize) throws DocumentToLargeException
Overrridden to ensure the size of the cursors ids array is not too large.
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 the kill_cursors 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 the kill_cursors 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.