All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kolibrifx.plovercrest.server.internal.protocol.SubscriberAck Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
 */

package com.kolibrifx.plovercrest.server.internal.protocol;

import java.nio.ByteBuffer;
import com.kolibrifx.plovercrest.client.internal.remote.RemoteResponse;

public class SubscriberAck extends StandaloneSubscriberEvent {
    final long entryIndex;

    public SubscriberAck(final int subscriptionId, final long entryIndex) {
        super(subscriptionId);
        this.entryIndex = entryIndex;
    }

    @Override
    ByteBuffer serialize() {
        final ByteBuffer tmpBuffer = ByteBuffer.allocate(20);
        tmpBuffer.putInt(RemoteResponse.SUBSCRIBE_RESPONSE.getTag());
        tmpBuffer.putInt(subscriptionId);
        tmpBuffer.putLong(entryIndex);
        return tmpBuffer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy