Search in sources :

Example 76 with ClientMessage

use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.

the class ClientReplicatedMapProxy method containsValue.

@Override
public boolean containsValue(Object value) {
    checkNotNull(value, NULL_KEY_IS_NOT_ALLOWED);
    Data valueData = toData(value);
    ClientMessage request = ReplicatedMapContainsValueCodec.encodeRequest(name, valueData);
    ClientMessage response = invokeOnPartition(request, targetPartitionId);
    ReplicatedMapContainsValueCodec.ResponseParameters result = ReplicatedMapContainsValueCodec.decodeResponse(response);
    return result.response;
}
Also used : ReplicatedMapContainsValueCodec(com.hazelcast.client.impl.protocol.codec.ReplicatedMapContainsValueCodec) Data(com.hazelcast.nio.serialization.Data) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 77 with ClientMessage

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;
}
Also used : ReplicatedMapSizeCodec(com.hazelcast.client.impl.protocol.codec.ReplicatedMapSizeCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 78 with ClientMessage

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);
}
Also used : Data(com.hazelcast.nio.serialization.Data) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 79 with ClientMessage

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);
}
Also used : ReplicatedMapRemoveCodec(com.hazelcast.client.impl.protocol.codec.ReplicatedMapRemoveCodec) Data(com.hazelcast.nio.serialization.Data) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 80 with ClientMessage

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;
}
Also used : Data(com.hazelcast.nio.serialization.Data) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ReplicatedMapContainsKeyCodec(com.hazelcast.client.impl.protocol.codec.ReplicatedMapContainsKeyCodec)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)377 Data (com.hazelcast.nio.serialization.Data)140 ClientInvocation (com.hazelcast.client.spi.impl.ClientInvocation)47 ClientInvocationFuture (com.hazelcast.client.spi.impl.ClientInvocationFuture)37 SafeBuffer (com.hazelcast.client.impl.protocol.util.SafeBuffer)29 Address (com.hazelcast.nio.Address)25 QuickTest (com.hazelcast.test.annotation.QuickTest)24 Test (org.junit.Test)24 ClientDelegatingFuture (com.hazelcast.client.util.ClientDelegatingFuture)21 DataInputStream (java.io.DataInputStream)20 InputStream (java.io.InputStream)20 CacheEventData (com.hazelcast.cache.impl.CacheEventData)19 ParallelTest (com.hazelcast.test.annotation.ParallelTest)19 Member (com.hazelcast.core.Member)18 SerializationService (com.hazelcast.spi.serialization.SerializationService)18 ExecutionException (java.util.concurrent.ExecutionException)18 UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)16 ArrayList (java.util.ArrayList)16 QueryCacheEventData (com.hazelcast.map.impl.querycache.event.QueryCacheEventData)13 CacheException (javax.cache.CacheException)13