Search in sources :

Example 1 with CacheReplaceCodec

use of com.hazelcast.client.impl.protocol.codec.CacheReplaceCodec in project hazelcast by hazelcast.

the class ClientCacheProxySupport method doReplaceOnServer.

private CompletableFuture<Boolean> doReplaceOnServer(Data keyData, Data newValueData, Data oldValueData, Data expiryPolicyData, boolean withCompletionEvent, BiConsumer<Boolean, Throwable> statsCallback) {
    int completionId = withCompletionEvent ? nextCompletionId() : -1;
    ClientMessage request = CacheReplaceCodec.encodeRequest(nameWithPrefix, keyData, oldValueData, newValueData, expiryPolicyData, completionId);
    ClientDelegatingFuture<Boolean> delegatingFuture = newDelegatingFuture(invoke(request, keyData, completionId), CacheReplaceCodec::decodeResponse);
    return addCallback(delegatingFuture, statsCallback);
}
Also used : ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CacheReplaceCodec(com.hazelcast.client.impl.protocol.codec.CacheReplaceCodec)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 CacheReplaceCodec (com.hazelcast.client.impl.protocol.codec.CacheReplaceCodec)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1