use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method size.
@Override
public int size() {
ClientMessage request = ReplicatedMapSizeCodec.encodeRequest(name);
ClientMessage response = invokeOnPartition(request, targetPartitionId);
ReplicatedMapSizeCodec.ResponseParameters result = ReplicatedMapSizeCodec.decodeResponse(response);
return result.response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method addEntryListener.
@Override
public String addEntryListener(EntryListener<K, V> listener, Predicate<K, V> predicate, K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final Data keyData = toData(key);
final Data predicateData = toData(predicate);
EventHandler<ClientMessage> handler = createHandler(listener);
return registerListener(createEntryListenerToKeyWithPredicateCodec(keyData, predicateData), handler);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method remove.
@Override
public V remove(Object key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
Data keyData = toData(key);
ClientMessage request = ReplicatedMapRemoveCodec.encodeRequest(name, keyData);
ClientMessage response = invoke(request, keyData);
ReplicatedMapRemoveCodec.ResponseParameters result = ReplicatedMapRemoveCodec.decodeResponse(response);
return toObject(result.response);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method containsKey.
@Override
public boolean containsKey(Object key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
Data keyData = toData(key);
ClientMessage request = ReplicatedMapContainsKeyCodec.encodeRequest(name, keyData);
ClientMessage response = invoke(request, keyData);
ReplicatedMapContainsKeyCodec.ResponseParameters result = ReplicatedMapContainsKeyCodec.decodeResponse(response);
return result.response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientReplicatedMapProxy method keySet.
@Override
public Set<K> keySet() {
ClientMessage request = ReplicatedMapKeySetCodec.encodeRequest(name);
ClientMessage response = invokeOnPartition(request, targetPartitionId);
ReplicatedMapKeySetCodec.ResponseParameters result = ReplicatedMapKeySetCodec.decodeResponse(response);
List<Entry<K, V>> keys = new ArrayList<Entry<K, V>>(result.response.size());
for (Data dataKey : result.response) {
keys.add(new AbstractMap.SimpleImmutableEntry<K, V>((K) toObject(dataKey), null));
}
return new ResultSet(keys, IterationType.KEY);
}
Aggregations