Class ManualPatchsetCreated
java.lang.Object
com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent
com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
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, patchSetFields inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
account, eventCreatedOn, provider, receivedOn -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.ManualPatchsetCreated(net.sf.json.JSONObject change, net.sf.json.JSONObject patch, String userName) Standard Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(GerritEventLifecycleListener listener) Adds the listener to the list of listeners.voidFires the eventGerritEventLifecycleListener.allBuildsCompleted(GerritEvent).voidfireBuildCompleted(Run build) Fires the eventGerritEventLifecycleListener.buildCompleted(GerritEvent, Run).voidfireBuildStarted(Run build) Fires the eventGerritEventLifecycleListener.buildStarted(GerritEvent, Run).voidfireProjectTriggered(Job project) Fires the eventGerritEventLifecycleListener.projectTriggered(GerritEvent, Job).voidFires the eventGerritEventLifecycleListener.triggerScanDone(GerritEvent).voidFires the eventGerritEventLifecycleListener.triggerScanStarting(GerritEvent).voidfromJson(net.sf.json.JSONObject change, net.sf.json.JSONObject patch) Sets the relevant values from the JSONObjects.com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventgetEvent()The event associated with the lifecycle.protected List<GerritEventLifecycleListener>Gets a copy of the internal transient list of listeners.The name of the user who "created" the event.booleanremoveListener(GerritEventLifecycleListener listener) Removes the listener from the list of listeners.voidsetUserName(String userName) The name of the user who "created" the event.toString()Methods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
fromJson, getEventType, getModifiedProject, getModifiedRef, isScorableMethods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent
equals, getChange, getFiles, getPatchSet, hashCode, setChange, setPatchsetMethods inherited from class com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
getAccount, getEventCreatedOn, getProvider, getReceivedOn, setAccount, setEventCreatedOn, setProvider, setReceivedOn
-
Constructor Details
-
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 Details
-
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
The name of the user who "created" the event.- Returns:
- the userName.
-
setUserName
The name of the user who "created" the event.- Parameters:
userName- the userName.
-
toString
- Overrides:
toStringin classcom.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated
-
getEvent
public com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent getEvent()Description copied from interface:GerritEventLifecycleThe event associated with the lifecycle.- Specified by:
getEventin interfaceGerritEventLifecycle- Returns:
- The event
-
addListener
Description copied from interface:GerritEventLifecycleAdds the listener to the list of listeners.- Specified by:
addListenerin interfaceGerritEventLifecycle- Parameters:
listener- the listener to add.
-
removeListener
Description copied from interface:GerritEventLifecycleRemoves the listener from the list of listeners.- Specified by:
removeListenerin interfaceGerritEventLifecycle- Parameters:
listener- the listener to remove.- Returns:
- true if it was removed.
- See Also:
-
fireTriggerScanStarting
public void fireTriggerScanStarting()Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.triggerScanStarting(GerritEvent).- Specified by:
fireTriggerScanStartingin interfaceGerritEventLifecycle
-
fireTriggerScanDone
public void fireTriggerScanDone()Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.triggerScanDone(GerritEvent).- Specified by:
fireTriggerScanDonein interfaceGerritEventLifecycle
-
fireProjectTriggered
Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.projectTriggered(GerritEvent, Job).- Specified by:
fireProjectTriggeredin interfaceGerritEventLifecycle- Parameters:
project- the project that is triggered.
-
fireBuildStarted
Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.buildStarted(GerritEvent, Run).- Specified by:
fireBuildStartedin interfaceGerritEventLifecycle- Parameters:
build- the build that has started.
-
fireBuildCompleted
Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.buildCompleted(GerritEvent, Run).- Specified by:
fireBuildCompletedin interfaceGerritEventLifecycle- Parameters:
build- the build that is completed.
-
fireAllBuildsCompleted
public void fireAllBuildsCompleted()Description copied from interface:GerritEventLifecycleFires the eventGerritEventLifecycleListener.allBuildsCompleted(GerritEvent).- Specified by:
fireAllBuildsCompletedin interfaceGerritEventLifecycle
-
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.
-