Search in sources :

Example 6 with UnmodifiableLazyList

use of com.hazelcast.spi.impl.UnmodifiableLazyList in project hazelcast by hazelcast.

the class ClientTxnMultiMapProxy method remove.

@Override
public Collection<V> remove(Object key) {
    ClientMessage request = TransactionalMultiMapRemoveCodec.encodeRequest(name, getTransactionId(), getThreadId(), toData(key));
    ClientMessage response = invoke(request);
    List<Data> collection = TransactionalMultiMapRemoveCodec.decodeResponse(response).response;
    return new UnmodifiableLazyList<V>(collection, getSerializationService());
}
Also used : Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 7 with UnmodifiableLazyList

use of com.hazelcast.spi.impl.UnmodifiableLazyList in project hazelcast by hazelcast.

the class ClientMultiMapProxy method remove.

@Override
public Collection<V> remove(Object key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    Data keyData = toData(key);
    ClientMessage request = MultiMapRemoveCodec.encodeRequest(name, keyData, ThreadUtil.getThreadId());
    ClientMessage response = invoke(request, keyData);
    MultiMapRemoveCodec.ResponseParameters resultParameters = MultiMapRemoveCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : MultiMapRemoveCodec(com.hazelcast.client.impl.protocol.codec.MultiMapRemoveCodec) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 8 with UnmodifiableLazyList

use of com.hazelcast.spi.impl.UnmodifiableLazyList in project hazelcast by hazelcast.

the class ClientSetProxy method getAll.

private Collection<E> getAll() {
    ClientMessage request = SetGetAllCodec.encodeRequest(name);
    ClientMessage response = invokeOnPartition(request);
    SetGetAllCodec.ResponseParameters resultParameters = SetGetAllCodec.decodeResponse(response);
    List<Data> resultCollection = resultParameters.response;
    SerializationService serializationService = getContext().getSerializationService();
    return new UnmodifiableLazyList<E>(resultCollection, serializationService);
}
Also used : SetGetAllCodec(com.hazelcast.client.impl.protocol.codec.SetGetAllCodec) SerializationService(com.hazelcast.spi.serialization.SerializationService) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 9 with UnmodifiableLazyList

use of com.hazelcast.spi.impl.UnmodifiableLazyList in project hazelcast by hazelcast.

the class ClientMultiMapProxy method values.

@Override
public Collection<V> values() {
    ClientMessage request = MultiMapValuesCodec.encodeRequest(name);
    ClientMessage response = invoke(request);
    MultiMapValuesCodec.ResponseParameters resultParameters = MultiMapValuesCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : MultiMapValuesCodec(com.hazelcast.client.impl.protocol.codec.MultiMapValuesCodec) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 10 with UnmodifiableLazyList

use of com.hazelcast.spi.impl.UnmodifiableLazyList in project hazelcast by hazelcast.

the class ClientMultiMapProxy method get.

@Override
public Collection<V> get(K key) {
    checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
    Data keyData = toData(key);
    ClientMessage request = MultiMapGetCodec.encodeRequest(name, keyData, ThreadUtil.getThreadId());
    ClientMessage response = invoke(request, keyData);
    MultiMapGetCodec.ResponseParameters resultParameters = MultiMapGetCodec.decodeResponse(response);
    return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Also used : MultiMapGetCodec(com.hazelcast.client.impl.protocol.codec.MultiMapGetCodec) Data(com.hazelcast.nio.serialization.Data) UnmodifiableLazyList(com.hazelcast.spi.impl.UnmodifiableLazyList) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Aggregations

UnmodifiableLazyList (com.hazelcast.spi.impl.UnmodifiableLazyList)16 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)14 Data (com.hazelcast.nio.serialization.Data)8 SerializationService (com.hazelcast.spi.serialization.SerializationService)4 SerializableList (com.hazelcast.spi.impl.SerializableList)2 ListGetAllCodec (com.hazelcast.client.impl.protocol.codec.ListGetAllCodec)1 ListSubCodec (com.hazelcast.client.impl.protocol.codec.ListSubCodec)1 MapProjectCodec (com.hazelcast.client.impl.protocol.codec.MapProjectCodec)1 MapProjectWithPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapProjectWithPredicateCodec)1 MapValuesCodec (com.hazelcast.client.impl.protocol.codec.MapValuesCodec)1 MapValuesWithPredicateCodec (com.hazelcast.client.impl.protocol.codec.MapValuesWithPredicateCodec)1 MultiMapGetCodec (com.hazelcast.client.impl.protocol.codec.MultiMapGetCodec)1 MultiMapRemoveCodec (com.hazelcast.client.impl.protocol.codec.MultiMapRemoveCodec)1 MultiMapValuesCodec (com.hazelcast.client.impl.protocol.codec.MultiMapValuesCodec)1 ReplicatedMapValuesCodec (com.hazelcast.client.impl.protocol.codec.ReplicatedMapValuesCodec)1 SetGetAllCodec (com.hazelcast.client.impl.protocol.codec.SetGetAllCodec)1 CollectionGetAllOperation (com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation)1 ListSubOperation (com.hazelcast.collection.impl.list.operations.ListSubOperation)1 PagingPredicate (com.hazelcast.query.PagingPredicate)1 ArrayList (java.util.ArrayList)1