* 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) {
for (int i = 0; i < transportFactory.getTransportCount(); i++) {
Transport transport = getTransport(key, i == 0);
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);
} catch (TransportException te) {
logErrorAndThrowExceptionIfNeeded(i, te);
}
finally {