@Override protected CacheReplaceCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { return CacheReplaceCodec.decodeRequest(clientMessage); }
@Override public <T> T decodeClientMessage(ClientMessage clientMessage) { return (T) CacheReplaceCodec.decodeResponse(clientMessage).response; } };
@Override protected ClientMessage encodeResponse(Object response) { return CacheReplaceCodec.encodeResponse(serializationService.toData(response)); }
protected <T> ICompletableFuture<T> replaceAsyncInternal(K key, V oldValue, V newValue, ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async) { long startNanos = nowInNanosOrDefault(); ensureOpen(); if (hasOldValue) { validateNotNull(key, oldValue, newValue); validateConfiguredTypes(cacheConfig, key, oldValue, newValue); } else { validateNotNull(key, newValue); validateConfiguredTypes(cacheConfig, key, newValue); } Data keyData = toData(key); Data oldValueData = toData(oldValue); Data newValueData = toData(newValue); Data expiryPolicyData = toData(expiryPolicy); int completionId = withCompletionEvent ? nextCompletionId() : -1; ClientMessage request = CacheReplaceCodec.encodeRequest(nameWithPrefix, keyData, oldValueData, newValueData, expiryPolicyData, completionId); ClientInvocationFuture future = invoke(request, keyData, completionId); ClientDelegatingFuture<T> delegatingFuture = newDelegatingFuture(future, REPLACE_RESPONSE_DECODER); ExecutionCallback<T> callback = async && statisticsEnabled ? statsHandler.<T>newOnReplaceCallback(startNanos) : null; onReplaceInternalAsync(key, newValue, keyData, newValueData, delegatingFuture, callback); return delegatingFuture; }
@Override protected ClientMessage encodeResponse(Object response) { return CacheReplaceCodec.encodeResponse(serializationService.toData(response)); }
protected <T> ICompletableFuture<T> replaceAsyncInternal(K key, V oldValue, V newValue, ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async) { long startNanos = nowInNanosOrDefault(); ensureOpen(); if (hasOldValue) { validateNotNull(key, oldValue, newValue); validateConfiguredTypes(cacheConfig, key, oldValue, newValue); } else { validateNotNull(key, newValue); validateConfiguredTypes(cacheConfig, key, newValue); } Data keyData = toData(key); Data oldValueData = toData(oldValue); Data newValueData = toData(newValue); Data expiryPolicyData = toData(expiryPolicy); int completionId = withCompletionEvent ? nextCompletionId() : -1; ClientMessage request = CacheReplaceCodec.encodeRequest(nameWithPrefix, keyData, oldValueData, newValueData, expiryPolicyData, completionId); ClientInvocationFuture future = invoke(request, keyData, completionId); ClientDelegatingFuture<T> delegatingFuture = newDelegatingFuture(future, REPLACE_RESPONSE_DECODER); ExecutionCallback<T> callback = async && statisticsEnabled ? statsHandler.<T>newOnReplaceCallback(startNanos) : null; onReplaceInternalAsync(key, newValue, keyData, newValueData, delegatingFuture, callback); return delegatingFuture; }
@Override public <T> T decodeClientMessage(ClientMessage clientMessage) { return (T) CacheReplaceCodec.decodeResponse(clientMessage).response; } };
@Override protected CacheReplaceCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { return CacheReplaceCodec.decodeRequest(clientMessage); }