com.sonyericsson.hudson.plugins.gerrit.trigger.events
Class ManualPatchsetCreated

java.lang.Object
  extended by com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
      extended by com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent
          extended by com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
              extended by com.sonyericsson.hudson.plugins.gerrit.trigger.events.ManualPatchsetCreated
All Implemented Interfaces:
GerritEventLifecycle, com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent, com.sonymobile.tools.gerrit.gerritevents.dto.GerritJsonDTO, com.sonymobile.tools.gerrit.gerritevents.dto.GerritJsonEvent, com.sonymobile.tools.gerrit.gerritevents.dto.RepositoryModifiedEvent

public class ManualPatchsetCreated
extends com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
implements GerritEventLifecycle

Represents a Patchset manually selected to be built by a user.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Field Summary
 
Fields inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent
change, patchSet
 
Fields inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
account, provider, receivedOn
 
Constructor Summary
ManualPatchsetCreated()
          Default Constructor.
ManualPatchsetCreated(net.sf.json.JSONObject change, net.sf.json.JSONObject patch, String userName)
          Standard Constructor.
 
Method Summary
 void addListener(GerritEventLifecycleListener listener)
          Adds the listener to the list of listeners.
 void fireAllBuildsCompleted()
          Fires the event GerritEventLifecycleListener.allBuildsCompleted(GerritEvent).
 void fireBuildCompleted(hudson.model.AbstractBuild build)
          Fires the event GerritEventLifecycleListener.buildCompleted(GerritEvent, AbstractBuild).
 void fireBuildStarted(hudson.model.AbstractBuild build)
          Fires the event GerritEventLifecycleListener.buildStarted(GerritEvent, AbstractBuild).
 void fireProjectTriggered(hudson.model.AbstractProject project)
          Fires the event GerritEventLifecycleListener.projectTriggered(GerritEvent, AbstractProject).
 void fireTriggerScanDone()
          Fires the event GerritEventLifecycleListener.triggerScanDone(GerritEvent).
 void fireTriggerScanStarting()
          Fires the event GerritEventLifecycleListener.triggerScanStarting(GerritEvent).
 void fromJson(net.sf.json.JSONObject change, net.sf.json.JSONObject patch)
          Sets the relevant values from the JSONObjects.
 com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent getEvent()
          The event associated with the lifecycle.
protected  List<GerritEventLifecycleListener> getListeners()
          Gets a copy of the internal transient list of listeners.
 String getUserName()
          The name of the user who "created" the event.
 boolean removeListener(GerritEventLifecycleListener listener)
          Removes the listener from the list of listeners.
 void setUserName(String userName)
          The name of the user who "created" the event.
 String toString()
           
 
Methods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
fromJson, getEventType, getModifiedProject, getModifiedRef, isScorable
 
Methods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent
equals, getChange, getFiles, getPatchSet, hashCode, setChange, setPatchset
 
Methods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
getAccount, getProvider, getReceivedOn, setAccount, setProvider, setReceivedOn
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManualPatchsetCreated

public ManualPatchsetCreated()
Default Constructor.


ManualPatchsetCreated

public ManualPatchsetCreated(net.sf.json.JSONObject change,
                             net.sf.json.JSONObject patch,
                             String userName)
Standard Constructor.

Parameters:
change - JSONObject containing the change information.
patch - JSONObject containing the patchSet information.
userName - the user that manually fired the Gerrit event.
Method Detail

fromJson

public void fromJson(net.sf.json.JSONObject change,
                     net.sf.json.JSONObject patch)
Sets the relevant values from the JSONObjects.

Parameters:
change - the change info.
patch - the patchSet info.

getUserName

public String getUserName()
The name of the user who "created" the event.

Returns:
the userName.

setUserName

public void setUserName(String userName)
The name of the user who "created" the event.

Parameters:
userName - the userName.

toString

public String toString()
Overrides:
toString in class com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated

getEvent

public com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent getEvent()
Description copied from interface: GerritEventLifecycle
The event associated with the lifecycle.

Specified by:
getEvent in interface GerritEventLifecycle
Returns:
The event

addListener

public void addListener(GerritEventLifecycleListener listener)
Description copied from interface: GerritEventLifecycle
Adds the listener to the list of listeners.

Specified by:
addListener in interface GerritEventLifecycle
Parameters:
listener - the listener to add.

removeListener

public boolean removeListener(GerritEventLifecycleListener listener)
Description copied from interface: GerritEventLifecycle
Removes the listener from the list of listeners.

Specified by:
removeListener in interface GerritEventLifecycle
Parameters:
listener - the listener to remove.
Returns:
true if it was removed.
See Also:
List#remove(java.lang.Object)

fireTriggerScanStarting

public void fireTriggerScanStarting()
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.triggerScanStarting(GerritEvent).

Specified by:
fireTriggerScanStarting in interface GerritEventLifecycle

fireTriggerScanDone

public void fireTriggerScanDone()
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.triggerScanDone(GerritEvent).

Specified by:
fireTriggerScanDone in interface GerritEventLifecycle

fireProjectTriggered

public void fireProjectTriggered(hudson.model.AbstractProject project)
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.projectTriggered(GerritEvent, AbstractProject).

Specified by:
fireProjectTriggered in interface GerritEventLifecycle
Parameters:
project - the project that is triggered.

fireBuildStarted

public void fireBuildStarted(hudson.model.AbstractBuild build)
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.buildStarted(GerritEvent, AbstractBuild).

Specified by:
fireBuildStarted in interface GerritEventLifecycle
Parameters:
build - the build that has started.

fireBuildCompleted

public void fireBuildCompleted(hudson.model.AbstractBuild build)
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.buildCompleted(GerritEvent, AbstractBuild).

Specified by:
fireBuildCompleted in interface GerritEventLifecycle
Parameters:
build - the build that is completed.

fireAllBuildsCompleted

public void fireAllBuildsCompleted()
Description copied from interface: GerritEventLifecycle
Fires the event GerritEventLifecycleListener.allBuildsCompleted(GerritEvent).

Specified by:
fireAllBuildsCompleted in interface GerritEventLifecycle

getListeners

protected List<GerritEventLifecycleListener> getListeners()
Gets a copy of the internal transient list of listeners.

Returns:
the copy of the list of listeners, or null if the origin list is null.


Copyright © 2004-2014. All Rights Reserved.