|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.triggers.Trigger<hudson.model.AbstractProject>
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger
public class GerritTrigger
Triggers a build based on Gerrit events.
Nested Class Summary | |
---|---|
static class |
GerritTrigger.DescriptorImpl
The Descriptor for the Trigger. |
Nested classes/interfaces inherited from class hudson.triggers.Trigger |
---|
hudson.triggers.Trigger.Cron |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary |
---|
Fields inherited from class hudson.triggers.Trigger |
---|
job, spec, tabs, timer |
Constructor Summary | |
---|---|
GerritTrigger(List<GerritProject> gerritProjects,
Integer gerritBuildStartedVerifiedValue,
Integer gerritBuildStartedCodeReviewValue,
Integer gerritBuildSuccessfulVerifiedValue,
Integer gerritBuildSuccessfulCodeReviewValue,
Integer gerritBuildFailedVerifiedValue,
Integer gerritBuildFailedCodeReviewValue,
Integer gerritBuildUnstableVerifiedValue,
Integer gerritBuildUnstableCodeReviewValue,
boolean silentMode,
boolean escapeQuotes,
String buildStartMessage,
String buildSuccessfulMessage,
String buildUnstableMessage,
String buildFailureMessage)
Default DataBound Constructor. |
Method Summary | |
---|---|
protected hudson.model.ParametersAction |
createParameters(PatchsetCreated event,
hudson.model.AbstractProject project)
Creates a ParameterAction and fills it with the project's default parameters + the Standard Gerrit parameters. |
void |
gerritEvent(ChangeAbandoned event)
Called when a ChangeAbandoned event arrives. |
void |
gerritEvent(GerritEvent event)
|
void |
gerritEvent(PatchsetCreated event)
Called when a PatchSetCreated event arrives. |
String |
getBuildFailureMessage()
The message to show users when a build finishes, if custom messages are enabled. |
int |
getBuildScheduleDelay()
getBuildScheduleDelay method will return configured buildScheduledelay value. |
String |
getBuildStartMessage()
The message to show users when a build starts, if custom messages are enabled. |
String |
getBuildSuccessfulMessage()
The message to show users when a build succeeds, if custom messages are enabled. |
String |
getBuildUnstableMessage()
The message to show users when a build is unstable, if custom messages are enabled. |
Integer |
getGerritBuildFailedCodeReviewValue()
Job specific Gerrit code review vote when a build is failed, null means that the global value should be used. |
Integer |
getGerritBuildFailedVerifiedValue()
Job specific Gerrit verified vote when a build is failed, null means that the global value should be used. |
Integer |
getGerritBuildStartedCodeReviewValue()
Job specific Gerrit code review vote when a build is started, null means that the global value should be used. |
Integer |
getGerritBuildStartedVerifiedValue()
Job specific Gerrit verified vote when a build is started, null means that the global value should be used. |
Integer |
getGerritBuildSuccessfulCodeReviewValue()
Job specific Gerrit code review vote when a build is successful, null means that the global value should be used. |
Integer |
getGerritBuildSuccessfulVerifiedValue()
Job specific Gerrit verified vote when a build is successful, null means that the global value should be used. |
Integer |
getGerritBuildUnstableCodeReviewValue()
Job specific Gerrit code review vote when a build is unstable, null means that the global value should be used. |
Integer |
getGerritBuildUnstableVerifiedValue()
Job specific Gerrit verified vote when a build is unstable, null means that the global value should be used. |
List<GerritProject> |
getGerritProjects()
The list of GerritProject triggering rules. |
int |
hashCode()
|
boolean |
isEscapeQuotes()
if escapeQuotes is on or off. |
boolean |
isSilentMode()
If silent mode is on or off. |
void |
retriggerAllBuilds(TriggerContext context)
Retriggers all builds in the given context. |
void |
retriggerThisBuild(TriggerContext context)
Re-triggers the build in TriggerContext.getThisBuild() for the context's event. |
protected void |
schedule(GerritCause cause,
PatchsetCreated event)
Schedules a build with parameters from the event. |
protected void |
schedule(GerritCause cause,
PatchsetCreated event,
hudson.model.AbstractProject project)
Schedules a build with parameters from the event. |
void |
setEscapeQuotes(boolean escapeQuotes)
Sets escapeQuotes to on or off. |
void |
setGerritBuildFailedCodeReviewValue(Integer gerritBuildFailedCodeReviewValue)
Job specific Gerrit code review vote when a build is failed, providing null means that the global value should be used. |
void |
setGerritBuildFailedVerifiedValue(Integer gerritBuildFailedVerifiedValue)
Job specific Gerrit verified vote when a build is failed, providing null means that the global value should be used. |
void |
setGerritBuildStartedCodeReviewValue(Integer gerritBuildStartedCodeReviewValue)
Job specific Gerrit code review vote when a build is started, providing null means that the global value should be used. |
void |
setGerritBuildStartedVerifiedValue(Integer gerritBuildStartedVerifiedValue)
Job specific Gerrit verified vote when a build is started, providing null means that the global value should be used. |
void |
setGerritBuildSuccessfulCodeReviewValue(Integer gerritBuildSuccessfulCodeReviewValue)
Job specific Gerrit code review vote when a build is successful, providing null means that the global value should be used. |
void |
setGerritBuildSuccessfulVerifiedValue(Integer gerritBuildSuccessfulVerifiedValue)
Job specific Gerrit verified vote when a build is successful, providing null means that the global value should be used. |
void |
setGerritBuildUnstableCodeReviewValue(Integer gerritBuildUnstableCodeReviewValue)
Job specific Gerrit code review vote when a build is unstable, providing null means that the global value should be used. |
void |
setGerritBuildUnstableVerifiedValue(Integer gerritBuildUnstableVerifiedValue)
Job specific Gerrit verified vote when a build is unstable, providing null means that the global value should be used. |
void |
setGerritProjects(List<GerritProject> gerritProjects)
The list of GerritProject triggering rules. |
void |
setSilentMode(boolean silentMode)
Sets silent mode to on or off. |
void |
start(hudson.model.AbstractProject project,
boolean newInstance)
|
void |
stop()
|
Methods inherited from class hudson.triggers.Trigger |
---|
all, checkTriggers, for_, getDescriptor, getProjectAction, getProjectActions, getSpec, init, readResolve, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@DataBoundConstructor public GerritTrigger(List<GerritProject> gerritProjects, Integer gerritBuildStartedVerifiedValue, Integer gerritBuildStartedCodeReviewValue, Integer gerritBuildSuccessfulVerifiedValue, Integer gerritBuildSuccessfulCodeReviewValue, Integer gerritBuildFailedVerifiedValue, Integer gerritBuildFailedCodeReviewValue, Integer gerritBuildUnstableVerifiedValue, Integer gerritBuildUnstableCodeReviewValue, boolean silentMode, boolean escapeQuotes, String buildStartMessage, String buildSuccessfulMessage, String buildUnstableMessage, String buildFailureMessage)
gerritProjects
- the set of triggering rules.gerritBuildStartedVerifiedValue
- Job specific Gerrit verified vote when a build is started,
null means that the global value should be used.gerritBuildStartedCodeReviewValue
- Job specific Gerrit code review vote when a build is started,
null means that the global value should be used.gerritBuildSuccessfulVerifiedValue
- Job specific Gerrit verified vote when a build is successful,
null means that the global value should be used.gerritBuildSuccessfulCodeReviewValue
- Job specific Gerrit code review vote when a build is successful,
null means that the global value should be used.gerritBuildFailedVerifiedValue
- Job specific Gerrit verified vote when a build is failed,
null means that the global value should be used.gerritBuildFailedCodeReviewValue
- Job specific Gerrit code review vote when a build is failed,
null means that the global value should be used.gerritBuildUnstableVerifiedValue
- Job specific Gerrit verified vote when a build is unstable,
null means that the global value should be used.gerritBuildUnstableCodeReviewValue
- Job specific Gerrit code review vote when a build is unstable,
null means that the global value should be used.silentMode
- Silent Mode on or off.escapeQuotes
- EscapeQuotes on or off.buildStartMessage
- Message to write to Gerrit when a build beginsbuildSuccessfulMessage
- Message to write to Gerrit when a build succeedsbuildUnstableMessage
- Message to write to Gerrit when a build is unstablebuildFailureMessage
- Message to write to Gerrit when a build failsMethod Detail |
---|
public void start(hudson.model.AbstractProject project, boolean newInstance)
start
in class hudson.triggers.Trigger<hudson.model.AbstractProject>
public void stop()
stop
in class hudson.triggers.Trigger<hudson.model.AbstractProject>
public void gerritEvent(GerritEvent event)
gerritEvent
in interface GerritEventListener
public void gerritEvent(PatchsetCreated event)
gerritEvent
in interface GerritEventListener
event
- the eventprotected void schedule(GerritCause cause, PatchsetCreated event)
myProject
as the project to build.
cause
- the cause of the build.event
- the event.protected void schedule(GerritCause cause, PatchsetCreated event, hudson.model.AbstractProject project)
cause
- the cause of the build.event
- the event.project
- the project to build.public int getBuildScheduleDelay()
GerritDefaultValues.DEFAULT_BUILD_SCHEDULE_DELAY
.
protected hudson.model.ParametersAction createParameters(PatchsetCreated event, hudson.model.AbstractProject project)
event
- the event.project
- the project.
public void retriggerThisBuild(TriggerContext context)
TriggerContext.getThisBuild()
for the context's event.
Will not do any
isInteresting(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.PatchsetCreated)
checks.
If more than one build was triggered by the event the results from those builds will be counted again,
but they won't be re-triggered.
If any builds for the event are still running, this new scheduled build will replace its predesessor.
If the project is currently building the event, no scheduling will be done.
context
- the previous context.public void retriggerAllBuilds(TriggerContext context)
context
- the context to rebuild.ToGerritRunListener.isBuilding(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.PatchsetCreated)
public int hashCode()
hashCode
in class Object
public void gerritEvent(ChangeAbandoned event)
gerritEvent
in interface GerritEventListener
event
- the event.public List<GerritProject> getGerritProjects()
public void setGerritProjects(List<GerritProject> gerritProjects)
gerritProjects
- the rule-setpublic Integer getGerritBuildFailedCodeReviewValue()
public void setGerritBuildFailedCodeReviewValue(Integer gerritBuildFailedCodeReviewValue)
gerritBuildFailedCodeReviewValue
- the vote value.public Integer getGerritBuildFailedVerifiedValue()
public void setGerritBuildFailedVerifiedValue(Integer gerritBuildFailedVerifiedValue)
gerritBuildFailedVerifiedValue
- the vote value.public Integer getGerritBuildStartedCodeReviewValue()
public void setGerritBuildStartedCodeReviewValue(Integer gerritBuildStartedCodeReviewValue)
gerritBuildStartedCodeReviewValue
- the vote value.public Integer getGerritBuildStartedVerifiedValue()
public void setGerritBuildStartedVerifiedValue(Integer gerritBuildStartedVerifiedValue)
gerritBuildStartedVerifiedValue
- the vote value.public Integer getGerritBuildSuccessfulCodeReviewValue()
public void setGerritBuildSuccessfulCodeReviewValue(Integer gerritBuildSuccessfulCodeReviewValue)
gerritBuildSuccessfulCodeReviewValue
- the vote value.public Integer getGerritBuildSuccessfulVerifiedValue()
public void setGerritBuildSuccessfulVerifiedValue(Integer gerritBuildSuccessfulVerifiedValue)
gerritBuildSuccessfulVerifiedValue
- the vote value.public Integer getGerritBuildUnstableCodeReviewValue()
public void setGerritBuildUnstableCodeReviewValue(Integer gerritBuildUnstableCodeReviewValue)
gerritBuildUnstableCodeReviewValue
- the vote value.public Integer getGerritBuildUnstableVerifiedValue()
public void setGerritBuildUnstableVerifiedValue(Integer gerritBuildUnstableVerifiedValue)
gerritBuildUnstableVerifiedValue
- the vote value.public boolean isSilentMode()
public boolean isEscapeQuotes()
public void setEscapeQuotes(boolean escapeQuotes)
escapeQuotes
- is true if escapeQuotes should be on.public String getBuildStartMessage()
public String getBuildSuccessfulMessage()
public String getBuildUnstableMessage()
public String getBuildFailureMessage()
public void setSilentMode(boolean silentMode)
silentMode
- true if silent mode should be on.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |