com.kolibrifx.plovercrest.server.internal.protocol.SubscriberAck Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
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;
}
}