Class GerritNotifier
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.GerritNotifier
-
public class GerritNotifier extends Object
Start position that notifies Gerrit of events.- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
-
-
Constructor Summary
Constructors Constructor Description GerritNotifier(IGerritHudsonTriggerConfig config, com.sonymobile.tools.gerrit.gerritevents.GerritCmdRunner cmdRunner)
Constructor.GerritNotifier(IGerritHudsonTriggerConfig config, com.sonymobile.tools.gerrit.gerritevents.GerritCmdRunner cmdRunner, Jenkins jenkins)
Constructor for testing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildCompleted(BuildMemory.MemoryImprint memoryImprint, TaskListener listener)
Generates the build-completed command based on configured templates and build-values and sends it to Gerrit.void
buildStarted(Run build, TaskListener taskListener, com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, BuildsStartedStats stats)
Generates the build-started command based on configured templates and build-values and sends it to Gerrit.
-
-
-
Constructor Detail
-
GerritNotifier
public GerritNotifier(IGerritHudsonTriggerConfig config, com.sonymobile.tools.gerrit.gerritevents.GerritCmdRunner cmdRunner)
Constructor.- Parameters:
config
- the config.cmdRunner
- the command-runner.
-
GerritNotifier
public GerritNotifier(IGerritHudsonTriggerConfig config, com.sonymobile.tools.gerrit.gerritevents.GerritCmdRunner cmdRunner, Jenkins jenkins)
Constructor for testing.- Parameters:
config
- the config.cmdRunner
- the command-runner.jenkins
- the Jenkins instance.
-
-
Method Detail
-
buildStarted
public void buildStarted(Run build, TaskListener taskListener, com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, BuildsStartedStats stats)
Generates the build-started command based on configured templates and build-values and sends it to Gerrit.- Parameters:
build
- the build.taskListener
- the taskListener.event
- the event.stats
- the stats.
-
buildCompleted
public void buildCompleted(BuildMemory.MemoryImprint memoryImprint, TaskListener listener)
Generates the build-completed command based on configured templates and build-values and sends it to Gerrit.- Parameters:
memoryImprint
- the memory of all the builds for an event.listener
- the taskListener.
-
-