Search in sources :

Example 1 with ResponseParameters

use of com.hazelcast.client.impl.protocol.codec.MapEventJournalSubscribeCodec.ResponseParameters in project hazelcast by hazelcast.

the class ClientMapProxy method subscribeToEventJournal.

@Override
public InternalCompletableFuture<EventJournalInitialSubscriberState> subscribeToEventJournal(int partitionId) {
    final ClientMessage request = MapEventJournalSubscribeCodec.encodeRequest(name);
    final ClientInvocationFuture fut = new ClientInvocation(getClient(), request, getName(), partitionId).invoke();
    return new ClientDelegatingFuture<>(fut, getSerializationService(), message -> {
        ResponseParameters resp = MapEventJournalSubscribeCodec.decodeResponse(message);
        return new EventJournalInitialSubscriberState(resp.oldestSequence, resp.newestSequence);
    });
}
Also used : EventJournalInitialSubscriberState(com.hazelcast.internal.journal.EventJournalInitialSubscriberState) ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) ResponseParameters(com.hazelcast.client.impl.protocol.codec.MapEventJournalSubscribeCodec.ResponseParameters) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Aggregations

ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)1 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 ResponseParameters (com.hazelcast.client.impl.protocol.codec.MapEventJournalSubscribeCodec.ResponseParameters)1 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)1 ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)1 EventJournalInitialSubscriberState (com.hazelcast.internal.journal.EventJournalInitialSubscriberState)1