* ForceReturnPreviousValue has been passed, this responses will contain previous [value length][value] for that key.
* If the key does not exist or previous was null, value length would be 0. Otherwise, if no ForceReturnPreviousValue
* was sent, the response would be empty.
*/
public VersionedOperationResponse replaceIfUnmodified(byte[] key, byte[] value, int lifespan, int maxIdle, long version, Flag... flags) {
Transport transport = transportFactory.getTransport(key);
try {
// 1) write header
long messageId = HotRodOperationsHelper.writeHeader(transport, REPLACE_IF_UNMODIFIED_REQUEST, cacheName, topologyId, flags);
//2) write message body
transport.writeArray(key);
transport.writeVInt(lifespan);
transport.writeVInt(maxIdle);
transport.writeLong(version);
transport.writeArray(value);
return returnVersionedOperationResponse(transport, messageId, REPLACE_IF_UNMODIFIED_RESPONSE, flags);
} finally {
releaseTransport(transport);
}
}