Package com.mongodb.internal.connection
Class ReplyHeader
java.lang.Object
com.mongodb.internal.connection.ReplyHeader
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Contains the details of a reply from a MongoDB server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Deprecated.The length of the OP_REPLY header in the MongoDB wire protocol.static final int
Deprecated.The length of the OP_REPLY header plus the length of the standard message header -
Method Summary
Modifier and TypeMethodDescriptionlong
Deprecated.Gets the cursor ID that this response is a part of.int
Deprecated.Gets the total size of the message in bytes.int
Deprecated.Gets the number of documents to expect in the body of this reply.int
Deprecated.This is a client or database-generated identifier that uniquely identifies this message.int
Deprecated.Gets additional information about the response.int
Deprecated.Along with the requestID field in queries, clients can use this to associate query responses with the originating query.int
Deprecated.Returns the position in the cursor that is the start point of this reply.boolean
Deprecated.Gets whether this query was performed with a cursor ID that was not valid on the server.boolean
Deprecated.Gets whether the query failed or not.
-
Field Details
-
REPLY_HEADER_LENGTH
public static final int REPLY_HEADER_LENGTHDeprecated.The length of the OP_REPLY header in the MongoDB wire protocol.- See Also:
-
TOTAL_REPLY_HEADER_LENGTH
public static final int TOTAL_REPLY_HEADER_LENGTHDeprecated.The length of the OP_REPLY header plus the length of the standard message header- See Also:
-
-
Method Details
-
getMessageLength
public int getMessageLength()Deprecated.Gets the total size of the message in bytes. This total includes the 4 bytes that holds the message length.- Returns:
- the total message size, including all of the header
-
getRequestId
public int getRequestId()Deprecated.This is a client or database-generated identifier that uniquely identifies this message. Along with theresponseTo
field in responses, clients can use this to associate query responses with the originating query.- Returns:
- the identifier for this message
-
getResponseTo
public int getResponseTo()Deprecated.Along with the requestID field in queries, clients can use this to associate query responses with the originating query.- Returns:
- the request ID from the original request
-
getResponseFlags
public int getResponseFlags()Deprecated.Gets additional information about the response.- 0 - CursorNotFound: Set when getMore is called but the cursor id is not valid at the server. Returned with zero results.
- 1 - QueryFailure: Set when query failed. Results consist of one document containing an "$err" field describing the failure.
- 2 - ShardConfigStale: Drivers should ignore this. Only mongos will ever see this set, in which case, it needs to update config from the server.
- 3 - AwaitCapable: Set when the server supports the AwaitData Query option. If it doesn't, a client should sleep a little between getMore's of a Tailable cursor. Mongod version 1.6 supports AwaitData and thus always sets AwaitCapable.
- 4-31 - Reserved: Ignore
- Returns:
- bit vector - see details above
-
getCursorId
public long getCursorId()Deprecated.Gets the cursor ID that this response is a part of. If there are no more documents to fetch from the server, the cursor ID will be 0. This cursor ID must be used in any messages used to get more data, and also must be closed by the client when no longer needed.- Returns:
- cursor ID to use if the client needs to fetch more from the server
-
getStartingFrom
public int getStartingFrom()Deprecated.Returns the position in the cursor that is the start point of this reply.- Returns:
- where in the cursor this reply is starting
-
getNumberReturned
public int getNumberReturned()Deprecated.Gets the number of documents to expect in the body of this reply.- Returns:
- number of documents in the reply
-
isCursorNotFound
public boolean isCursorNotFound()Deprecated.Gets whether this query was performed with a cursor ID that was not valid on the server.- Returns:
- true if this reply indicates the request to get more data was performed with a cursor ID that's not valid on the server
-
isQueryFailure
public boolean isQueryFailure()Deprecated.Gets whether the query failed or not.- Returns:
- true if this reply indicates the query failed.
-