Search in sources :

Example 21 with ClientMessage

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

the class ClientLockProxy method lock.

@Override
public void lock(long leaseTime, TimeUnit timeUnit) {
    checkPositive(leaseTime, "leaseTime should be positive");
    ClientMessage request = LockLockCodec.encodeRequest(name, getTimeInMillis(leaseTime, timeUnit), ThreadUtil.getThreadId(), referenceIdGenerator.getNextReferenceId());
    invokeOnPartition(request);
}
Also used : ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 22 with ClientMessage

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

the class ClientMapProxy method removeAllInternal.

protected void removeAllInternal(Predicate predicate) {
    ClientMessage request = MapRemoveAllCodec.encodeRequest(name, toData(predicate));
    invoke(request);
}
Also used : ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 23 with ClientMessage

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

the class ClientMapProxy method getInternal.

protected Object getInternal(Data keyData) {
    ClientMessage request = MapGetCodec.encodeRequest(name, keyData, getThreadId());
    ClientMessage response = invoke(request, keyData);
    MapGetCodec.ResponseParameters resultParameters = MapGetCodec.decodeResponse(response);
    return resultParameters.response;
}
Also used : MapGetCodec(com.hazelcast.client.impl.protocol.codec.MapGetCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 24 with ClientMessage

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

the class ClientMapProxy method forceUnlock.

@Override
public void forceUnlock(K key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    final Data keyData = toData(key);
    ClientMessage request = MapForceUnlockCodec.encodeRequest(name, keyData, lockReferenceIdGenerator.getNextReferenceId());
    invoke(request, keyData);
}
Also used : Data(com.hazelcast.nio.serialization.Data) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 25 with ClientMessage

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

the class ClientMapProxy method size.

@Override
public int size() {
    ClientMessage request = MapSizeCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    MapSizeCodec.ResponseParameters resultParameters = MapSizeCodec.decodeResponse(response);
    return resultParameters.response;
}
Also used : MapSizeCodec(com.hazelcast.client.impl.protocol.codec.MapSizeCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

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