public interface Message
Modifier and Type | Method and Description |
---|---|
String |
getDatabaseName()
Returns the name of the database.
|
String |
getOperationName()
Returns a short name for the operation.
|
ReadPreference |
getReadPreference()
Provides the details on which servers are eligible to receive the
message.
|
VersionRange |
getRequiredVersionRange()
Returns the required version range for the message.
|
int |
size()
Returns the total size of the message on the wire.
|
void |
validateSize(SizeOfVisitor visitor,
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.
|
String getDatabaseName()
String getOperationName()
ReadPreference getReadPreference()
ReadPreference
for which servers should be sent the
request.VersionRange getRequiredVersionRange()
This may be null
which should be interpreted to mean that all
versions of the server support the message's operation. In reality that
is probably more accurately stated as all supported versions.
int size()
void validateSize(SizeOfVisitor visitor, int maxDocumentSize) throws DocumentToLargeException
visitor
- The SizeOfVisitor
to compute the size of the document.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.void write(int messageId, BsonOutputStream out) throws IOException
messageId
- The id to be assigned to the message.out
- The sink for data written.IOException
- On an error writing to the stream.void write(int messageId, BufferingBsonOutputStream out) throws IOException
messageId
- The id to be assigned to the message.out
- The sink for data written.IOException
- On an error writing to the stream.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.