Class RunningJobs
java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.RunningJobs
Class for maintaining and synchronizing the runningJobs info.
 Association between patches and the jobs that we're running for them.
- 
Constructor SummaryConstructorsConstructorDescriptionRunningJobs(GerritTrigger trigger, Item job) Constructor: embeds the trigger and it's underlying job into the tracked list.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Adds the event to the running jobs.voidcancelTriggeredJob(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event, String jobName, BuildCancellationPolicy policy) Called when trigger has cancellation policy associated with it.getJob()booleanremove(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Removes any reference to the current build for this change.voidscheduled(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Checks scheduled job and cancels current jobs if needed.void
- 
Constructor Details- 
RunningJobsConstructor: embeds the trigger and it's underlying job into the tracked list.- Parameters:
- trigger- - gerrit trigger that has multiple running jobs
- job- - underlying job of running build and triggers
 
 
- 
- 
Method Details- 
getJob- Returns:
- the job
 
- 
setJob- Parameters:
- job- the job to set
 
- 
cancelTriggeredJobpublic void cancelTriggeredJob(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event, String jobName, BuildCancellationPolicy policy) Called when trigger has cancellation policy associated with it.- Parameters:
- event- event that is trigger builds
- jobName- job name to match for specific cancellation
- policy- policy to decide cancelling build or not
 
- 
scheduledpublic void scheduled(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Checks scheduled job and cancels current jobs if needed. I.e. cancelling the old build if configured to do so and removing and storing any references. Only used by Server wide policy- Parameters:
- event- the event triggering a new build.
 
- 
addpublic void add(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Adds the event to the running jobs.- Parameters:
- event- The ChangeBasedEvent.
 
- 
removepublic boolean remove(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event) Removes any reference to the current build for this change.- Parameters:
- event- the event which started the build we want to remove.
- Returns:
- true if event was still running.
 
 
-