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>
  • 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

      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

      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:
    • getShortDescription

      public String getShortDescription()
      Overrides:
      getShortDescription in class SCMTrigger.SCMTriggerCause
    • getUrl

      public String getUrl()
      Gets the URL to the Gerrit patchSet.
      Returns:
      the URL. Empty String if no server found.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class SCMTrigger.SCMTriggerCause
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SCMTrigger.SCMTriggerCause