class UpdateProtocol extends WriteProtocol
Modifier and Type | Field and Description |
---|---|
private static Logger |
LOGGER |
private java.util.List<UpdateRequest> |
updates |
Constructor and Description |
---|
UpdateProtocol(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
java.util.List<UpdateRequest> updates) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendToWriteCommandResponseDocument(RequestMessage curMessage,
RequestMessage nextMessage,
WriteConcernResult writeConcernResult,
BsonDocument response) |
protected RequestMessage |
createRequestMessage(MessageSettings settings)
Create the initial request message for the write.
|
WriteConcernResult |
execute(InternalConnection connection)
Execute the protocol.
|
void |
executeAsync(InternalConnection connection,
SingleResultCallback<WriteConcernResult> callback)
Execute the protocol asynchronously.
|
protected BsonDocument |
getAsWriteCommand(ByteBufferBsonOutput bsonOutput,
int firstDocumentPosition) |
protected Logger |
getLogger()
Gets the logger.
|
getBaseCommandDocument, getCommandName, getNamespace, getWriteConcern, isOrdered, setCommandListener
private static final Logger LOGGER
private final java.util.List<UpdateRequest> updates
UpdateProtocol(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, java.util.List<UpdateRequest> updates)
public WriteConcernResult execute(InternalConnection connection)
Protocol
execute
in interface Protocol<WriteConcernResult>
execute
in class WriteProtocol
connection
- the connection to execute the protocol onpublic void executeAsync(InternalConnection connection, SingleResultCallback<WriteConcernResult> callback)
Protocol
executeAsync
in interface Protocol<WriteConcernResult>
executeAsync
in class WriteProtocol
connection
- the connection to execute the protocol oncallback
- the callback that is passed the result of the executionprotected BsonDocument getAsWriteCommand(ByteBufferBsonOutput bsonOutput, int firstDocumentPosition)
getAsWriteCommand
in class WriteProtocol
protected RequestMessage createRequestMessage(MessageSettings settings)
WriteProtocol
createRequestMessage
in class WriteProtocol
settings
- the message settingsprotected void appendToWriteCommandResponseDocument(RequestMessage curMessage, RequestMessage nextMessage, WriteConcernResult writeConcernResult, BsonDocument response)
appendToWriteCommandResponseDocument
in class WriteProtocol
protected Logger getLogger()
WriteProtocol
getLogger
in class WriteProtocol