java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.playback.EventTimeSlice

public class EventTimeSlice extends Object
This class holds events that were processed by the MissedEventPlaybackManager for the most recent timestamp. For example, if 3 events were received at t1, they would be present in the Event Slice. However, if another event is processed at t2, then the Event Slice would evict the previous events and only keep the new event at t2. Created by scott.hebert@ericsson.com on 12/12/14.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent>
    events to persist.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EventTimeSlice(long ts)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent evt)
    Add an event to the list.
    List<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent>
    get the events for this time slice.
    long
    Get the time slice in ms.
    Creates a shallow copy of a given EventTimeSlice.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • events

      protected List<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent> events
      events to persist.
  • Constructor Details

    • EventTimeSlice

      public EventTimeSlice(long ts)
      Parameters:
      ts - Time slice in ms to hold events for.
  • Method Details

    • getTimeSlice

      public long getTimeSlice()
      Get the time slice in ms.
      Returns:
      this time slice
    • addEvent

      public void addEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent evt)
      Add an event to the list.
      Parameters:
      evt - Event to be persisted.
    • getEvents

      public List<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent> getEvents()
      get the events for this time slice.
      Returns:
      events that pertain to the time slice.
    • shallowCopy

      public static EventTimeSlice shallowCopy(EventTimeSlice ets)
      Creates a shallow copy of a given EventTimeSlice.
      Parameters:
      ets - the EventTimeSlice to copy
      Returns:
      the copy