use of com.hazelcast.client.impl.protocol.codec.CacheSetExpiryPolicyCodec in project hazelcast by hazelcast.
the class ClientCacheProxySupport method setExpiryPolicyInternal.
protected boolean setExpiryPolicyInternal(K key, ExpiryPolicy expiryPolicy) {
ensureOpen();
validateNotNull(key);
validateNotNull(expiryPolicy);
Data keyData = toData(key);
Data expiryPolicyData = toData(expiryPolicy);
List<Data> list = Collections.singletonList(keyData);
ClientMessage request = CacheSetExpiryPolicyCodec.encodeRequest(nameWithPrefix, list, expiryPolicyData);
ClientInvocationFuture future = invoke(request, keyData, IGNORE_COMPLETION);
ClientDelegatingFuture<Boolean> delegatingFuture = newDelegatingFuture(future, CacheSetExpiryPolicyCodec::decodeResponse);
try {
return delegatingFuture.get();
} catch (Throwable e) {
throw rethrowAllowedTypeFirst(e, CacheException.class);
}
}
Aggregations