com.kolibrifx.plovercrest.server.internal.protocol.SubscriberEntry 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;
public class SubscriberEntry extends SubscriberEvent {
final long entryIndex;
final long timestamp;
final byte[] data;
public SubscriberEntry(final int subscriptionId, final long entryIndex, final long timestamp, final byte[] data) {
super(subscriptionId);
this.entryIndex = entryIndex;
this.timestamp = timestamp;
this.data = data;
}
static boolean areSuccessiveEntries(final SubscriberEntry a, final SubscriberEntry b) {
return a.entryIndex + 1 == b.entryIndex;
}
}