MutableEventLog
A MutableEventLog is an implementation of EventLog optimized for consecutive insertions and removals at the same index; this works particularly well when many events are appended to the end of a MutableEventLog, or when two MutableEventLog are merged.
See also
a variation of MutableEventLog which keeps a state
Functions
Acknowledges the latest SequenceNumber for each SiteIdentifier that the other MutableEventLog contains. The behavior of the acknowledgement will be similar to what the acknowledge method does.
Acknowledges the given SequenceNumber for a SiteIdentifier. The behavior of the acknowledgement will be similar to what the insert method does.
Returns an EventIdentifierArray with all the acknowledgements that have been issued by this MutableEventLog. This EventIdentifierArray only contains one EventIdentifier per SiteIdentifier.
Appends a new event in the MutableEventLog for the given SiteIdentifier. The MutableEventLog should be owned by the given SiteIdentifier, to ensure no duplicate insertions can occur.
Clears the data of the MutableEventLog. This will not necessarily reset the acknowledged events, which will still act as a baseline for event insertions and appends.
Returns true if the event with the event with the given EventIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.
Returns true if the event with the event with the given SiteIdentifier is included in the EventLog, or if any event with the same SiteIdentifier and a higher SequenceNumber has already been integrated.
Inserts the provided Event in the MutableEventLog at the appropriate index. If the event is already present, or an event with the same EventIdentifier has already been inserted, the insertion will simply be ignored.
Inserts the provided event in the MutableEventLog at the appropriate index. If the event is already present, or an event with the same SiteIdentifier has already been inserted, the insertion will simply be ignored.
Returns an EventIterator. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.
Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the beginning of the EventLog, and should not be used anymore if the underlying EventLog is modified.
Returns an EventIterator. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.
Returns an EventIterator specific to a single site. The retrieved EventIterator will start at the end of the EventLog, and should not be used anymore if the underlying EventLog is modified.
Merges this MutableEventLog another log. The merge operation has the following semantics :
Registers the provided OnLogUpdateListener to this EventLog.
Removes the event with the given seqno and site, assuming it's present in the MutableEventLog. An event that is not present will not be removed, and will not be marked acknowledged by the MutableEventLog either.
Unregisters the provided OnLogUpdateListener from this EventLog.