Class GerritCause
java.lang.Object
hudson.model.Cause
hudson.triggers.SCMTrigger.SCMTriggerCause
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritCause
- Direct Known Subclasses:
GerritUserCause
A Cause why a build was scheduled.
- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Cause
Cause.LegacyCodeCause, Cause.RemoteCause, Cause.UpstreamCause, Cause.UserCause, Cause.UserIdCause -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.GerritCause(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, boolean silentMode) Default DataBound Constructor.GerritCause(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, boolean silentMode, TriggerContext context) Default DataBound Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe context with information about other builds triggered for the same event as this one.com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEventgetEvent()The event.protected StringGives the short description of the GerritCause.protected StringGives the short description of the GerritCause in silent mode.getUrl()Gets the URL to the Gerrit patchSet.inthashCode()booleanGets the indication if silent mode was on or off when the build was triggered.voidsetContext(TriggerContext context) The context with information about other builds triggered for the same event as this one.voidsetEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event) The event.voidsetSilentMode(boolean silentMode) Sets the indication if silent mode was on or off when the build was triggered.toString()Methods inherited from class hudson.triggers.SCMTrigger.SCMTriggerCause
getRun, onAddedTo, onLoad
-
Constructor Details
-
GerritCause
public GerritCause(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, boolean silentMode) Default DataBound Constructor.- Parameters:
event- the event that triggered the build.silentMode- Silent Mode on or off.
-
GerritCause
public GerritCause(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, boolean silentMode, TriggerContext context) Default DataBound Constructor.- Parameters:
event- the event that triggered the build.silentMode- Silent Mode on or off.context- The context with information about other builds triggered for the same event as this one.
-
GerritCause
public GerritCause()Default Constructor.
-
-
Method Details
-
getEvent
public com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent getEvent()The event.- Returns:
- the event.
-
setEvent
public void setEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event) The event.- Parameters:
event- the event.
-
isSilentMode
public boolean isSilentMode()Gets the indication if silent mode was on or off when the build was triggered. When silent mode is on there will be no communication back to Gerrit, i.e. no build started/failed/successful approve messages etc. Default is false.- Returns:
- true if silent mode was on.
- See Also:
-
setSilentMode
public void setSilentMode(boolean silentMode) Sets the indication if silent mode was on or off when the build was triggered. When silent mode is on there will be no communication back to Gerrit, i.e. no build started/failed/successful approve messages etc. Default is false.- Parameters:
silentMode- true if silent mode was on.- See Also:
-
getContext
The context with information about other builds triggered for the same event as this one.- Returns:
- the context.
-
setContext
The context with information about other builds triggered for the same event as this one.- Parameters:
context- the context.
-
getShortGerritDescription
Gives the short description of the GerritCause. Intended to be overridden by subclasses.- Returns:
- the short description.
- See Also:
-
getShortGerritDescriptionSilentMode
Gives the short description of the GerritCause in silent mode. Intended to be overridden by subclasses.- Returns:
- the short description for silent mode.
- See Also:
-
getShortDescription
- Overrides:
getShortDescriptionin classSCMTrigger.SCMTriggerCause
-
getUrl
Gets the URL to the Gerrit patchSet.- Returns:
- the URL. Empty String if no server found.
-
toString
-
equals
- Overrides:
equalsin classSCMTrigger.SCMTriggerCause
-
hashCode
public int hashCode()- Overrides:
hashCodein classSCMTrigger.SCMTriggerCause
-