com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger
Class GerritCause

java.lang.Object
  extended by hudson.model.Cause
      extended by hudson.triggers.SCMTrigger.SCMTriggerCause
          extended by com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritCause
Direct Known Subclasses:
GerritUserCause

public class GerritCause
extends hudson.triggers.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
hudson.model.Cause.LegacyCodeCause, hudson.model.Cause.RemoteCause, hudson.model.Cause.UpstreamCause, hudson.model.Cause.UserCause, hudson.model.Cause.UserIdCause
 
Constructor Summary
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
 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
onAddedTo
 
Methods inherited from class hudson.model.Cause
print
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 class hudson.triggers.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 hudson.triggers.SCMTrigger.SCMTriggerCause

hashCode

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


Copyright © 2004-2014. All Rights Reserved.