com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual
Class TriggerMonitor

java.lang.Object
  extended by 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>

Nested Class Summary
static class TriggerMonitor.EventState
          State information about an event.
 
Constructor Summary
TriggerMonitor()
           
 
Method Summary
 void add(PatchsetCreated event)
          Adds the event and a holder for its state to the list of triggered events.
 void allBuildsCompleted(PatchsetCreated event)
           
 void buildCompleted(PatchsetCreated event, hudson.model.AbstractBuild build)
           
 void buildStarted(PatchsetCreated event, hudson.model.AbstractBuild build)
           
 boolean contains(PatchsetCreated event)
          Checks to see if the list of triggered events and their states contains the given event.
 List<TriggerMonitor.EventState> getEvents()
          The list of events and their states.
 Iterator<TriggerMonitor.EventState> getEventsIterator()
          An iterator of the list of events and their states.
 void projectTriggered(PatchsetCreated event, hudson.model.AbstractProject project)
           
 void triggerScanDone(PatchsetCreated event)
           
 void triggerScanStarting(PatchsetCreated event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriggerMonitor

public TriggerMonitor()
Method Detail

add

public void add(PatchsetCreated event)
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:
event - the event.

contains

public boolean contains(PatchsetCreated event)
Checks to see if the list of triggered events and their states contains the given event.

Parameters:
event - the event to check.
Returns:
true if it exests in the list.
See Also:
getEvents()

triggerScanStarting

public void triggerScanStarting(PatchsetCreated event)
Specified by:
triggerScanStarting in interface GerritEventLifecycleListener

triggerScanDone

public void triggerScanDone(PatchsetCreated event)
Specified by:
triggerScanDone in interface GerritEventLifecycleListener

projectTriggered

public void projectTriggered(PatchsetCreated event,
                             hudson.model.AbstractProject project)
Specified by:
projectTriggered in interface GerritEventLifecycleListener

buildStarted

public void buildStarted(PatchsetCreated event,
                         hudson.model.AbstractBuild build)
Specified by:
buildStarted in interface GerritEventLifecycleListener

buildCompleted

public void buildCompleted(PatchsetCreated event,
                           hudson.model.AbstractBuild build)
Specified by:
buildCompleted in interface GerritEventLifecycleListener

allBuildsCompleted

public void allBuildsCompleted(PatchsetCreated event)
Specified by:
allBuildsCompleted in interface GerritEventLifecycleListener

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.


Copyright © 2004-2011. All Rights Reserved.