java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.TriggerMonitor
All Implemented Interfaces:
GerritEventLifecycleListener

public class TriggerMonitor extends Object implements GerritEventLifecycleListener
Keeps track of the lifecycle of a GerritEvent.
Author:
Robert Sandell <robert.sandell@sonyericsson.com>
  • Constructor Details

    • TriggerMonitor

      public TriggerMonitor()
  • Method Details

    • add

      public void add(GerritEventLifecycle gerritEventLifecycle)
      Adds the event and a holder for its state to the list of triggered events. And adds this TriggerMonitor as a listener to the event. Unless it doesn't already exists in the list of events.
      Parameters:
      gerritEventLifecycle - the event.
    • contains

      public boolean contains(GerritEventLifecycle gerritEventLifecycle)
      Checks to see if the list of triggered events and their states contains the given event.
      Parameters:
      gerritEventLifecycle - the event to check.
      Returns:
      true if it exests in the list.
      See Also:
    • triggerScanStarting

      public void triggerScanStarting(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
      Description copied from interface: GerritEventLifecycleListener
      Called before any triggers are enumerated.
      Specified by:
      triggerScanStarting in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
    • triggerScanDone

      public void triggerScanDone(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
      Description copied from interface: GerritEventLifecycleListener
      Called after all triggers has been enumerated.
      Specified by:
      triggerScanDone in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
    • projectTriggered

      public void projectTriggered(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event, Job project)
      Description copied from interface: GerritEventLifecycleListener
      Called when the trigger of a project has decided to trigger on the event.
      Specified by:
      projectTriggered in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
      project - the project that was triggered.
    • buildStarted

      public void buildStarted(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event, Run build)
      Description copied from interface: GerritEventLifecycleListener
      Called when a build has started.
      Specified by:
      buildStarted in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
      build - the build.
    • buildCompleted

      public void buildCompleted(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event, Run build)
      Description copied from interface: GerritEventLifecycleListener
      Called when a build is completed.
      Specified by:
      buildCompleted in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
      build - the build.
    • allBuildsCompleted

      public void allBuildsCompleted(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
      Description copied from interface: GerritEventLifecycleListener
      Called when all builds triggered by the event are completed.
      Specified by:
      allBuildsCompleted in interface GerritEventLifecycleListener
      Parameters:
      event - the event.
    • getEvents

      public List<TriggerMonitor.EventState> getEvents()
      The list of events and their states.
      Returns:
      a list.
    • getEventsIterator

      public Iterator<TriggerMonitor.EventState> getEventsIterator()
      An iterator of the list of events and their states.
      Returns:
      a iterator.