// Path: src/main/java/com/oasisdigital/nges/cluster/EventUpdate.java
// public class EventUpdate implements Serializable {
//     private static final long serialVersionUID = 4220177459255722476L;
// 
//     private long eventId;
// 
//     public EventUpdate(long eventId) {
//         this.eventId = eventId;
//     }
// 
//     public long getEventId() {
//         return eventId;
//     }
// }
// 
// Path: src/main/java/com/oasisdigital/nges/cluster/MessageGroup.java
// public interface MessageGroup {
// 
//     /**
//      * Publish a message to the group.
//      */
//     public abstract void publish(Object message);
// 
//     /**
//      * Register a subscriber for messages from the group. See documentation for a particular implementation to
//      * learn more about its specifics.
//      */
//     public abstract void registerSubscriber(Object subscriber);
// 
//     /**
//      * Unregister a subscriber from the group.
//      */
//     public abstract void unregisterSubscriber(Object subscriber);
// 
// }


import com.oasisdigital.nges.cluster.EventUpdate;
import com.oasisdigital.nges.cluster.MessageGroup;
package com.oasisdigital.nges.event.internal;


/**
 * Publishes notifications to {@link MessageGroup} about the ID of the most recent event ID. Prevents
 * publishing a number that is before the last published one in order to avoid the stream from going backwards
 * in case of concurrent calls (e.g. from heartbeat and event store).
 */
public class EventStoreStatusPublisher {
    private final MessageGroup messageGroup;

    private long lastEventId = 0;

// Path: src/main/java/com/oasisdigital/nges/cluster/EventUpdate.java
// public class EventUpdate implements Serializable {
//     private static final long serialVersionUID = 4220177459255722476L;
// 
//     private long eventId;
// 
//     public EventUpdate(long eventId) {
//         this.eventId = eventId;
//     }
// 
//     public long getEventId() {
//         return eventId;
//     }
// }
// 
// Path: src/main/java/com/oasisdigital/nges/cluster/MessageGroup.java
// public interface MessageGroup {
// 
//     /**
//      * Publish a message to the group.
//      */
//     public abstract void publish(Object message);
// 
//     /**
//      * Register a subscriber for messages from the group. See documentation for a particular implementation to
//      * learn more about its specifics.
//      */
//     public abstract void registerSubscriber(Object subscriber);
// 
//     /**
//      * Unregister a subscriber from the group.
//      */
//     public abstract void unregisterSubscriber(Object subscriber);
// 
// }


// Path: src/main/java/com/oasisdigital/nges/event/internal/EventStoreStatusPublisher.java
import com.oasisdigital.nges.cluster.EventUpdate;
import com.oasisdigital.nges.cluster.MessageGroup;

package com.oasisdigital.nges.event.internal;


/**
 * Publishes notifications to {@link MessageGroup} about the ID of the most recent event ID. Prevents
 * publishing a number that is before the last published one in order to avoid the stream from going backwards
 * in case of concurrent calls (e.g. from heartbeat and event store).
 */
public class EventStoreStatusPublisher {
    private final MessageGroup messageGroup;

    private long lastEventId = 0;

    public EventStoreStatusPublisher(MessageGroup messageGroup) {