Class GerritCause
- java.lang.Object
-
- hudson.model.Cause
-
- hudson.triggers.SCMTrigger.SCMTriggerCause
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritCause
-
- Direct Known Subclasses:
GerritUserCause
public class GerritCause extends SCMTrigger.SCMTriggerCause
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
Constructors Constructor Description GerritCause()
Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
TriggerContext
getContext()
The context with information about other builds triggered for the same event as this one.com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
getEvent()
The event.String
getShortDescription()
protected String
getShortGerritDescription()
Gives the short description of the GerritCause.protected String
getShortGerritDescriptionSilentMode()
Gives the short description of the GerritCause in silent mode.String
getUrl()
Gets the URL to the Gerrit patchSet.int
hashCode()
boolean
isSilentMode()
Gets the indication if silent mode was on or off when the build was triggered.void
setContext(TriggerContext context)
The context with information about other builds triggered for the same event as this one.void
setEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
The event.void
setSilentMode(boolean silentMode)
Sets the indication if silent mode was on or off when the build was triggered.String
toString()
-
Methods inherited from class hudson.triggers.SCMTrigger.SCMTriggerCause
getRun, onAddedTo, onLoad
-
-
-
-
Constructor Detail
-
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 Detail
-
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:
GerritTrigger.isSilentMode()
-
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:
GerritTrigger.setSilentMode(boolean)
-
getContext
public TriggerContext getContext()
The context with information about other builds triggered for the same event as this one.- Returns:
- the context.
-
setContext
public void setContext(TriggerContext context)
The context with information about other builds triggered for the same event as this one.- Parameters:
context
- the context.
-
getShortGerritDescription
protected String getShortGerritDescription()
Gives the short description of the GerritCause. Intended to be overridden by subclasses.- Returns:
- the short description.
- See Also:
getShortGerritDescriptionSilentMode()
,getShortDescription()
-
getShortGerritDescriptionSilentMode
protected String 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:
getShortGerritDescription()
,getShortDescription()
-
getShortDescription
public String getShortDescription()
- Overrides:
getShortDescription
in classSCMTrigger.SCMTriggerCause
-
getUrl
public String getUrl()
Gets the URL to the Gerrit patchSet.- Returns:
- the URL. Empty String if no server found.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classSCMTrigger.SCMTriggerCause
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSCMTrigger.SCMTriggerCause
-
-