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>
-
-
Constructor Summary
Constructors Constructor Description ManualPatchsetCreated()
Default Constructor.ManualPatchsetCreated(net.sf.json.JSONObject change, net.sf.json.JSONObject patch, String userName)
Standard Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(GerritEventLifecycleListener listener)
Adds the listener to the list of listeners.void
fireAllBuildsCompleted()
Fires the eventGerritEventLifecycleListener.allBuildsCompleted(GerritEvent)
.void
fireBuildCompleted(Run build)
Fires the eventGerritEventLifecycleListener.buildCompleted(GerritEvent, Run)
.void
fireBuildStarted(Run build)
Fires the eventGerritEventLifecycleListener.buildStarted(GerritEvent, Run)
.void
fireProjectTriggered(Job project)
Fires the eventGerritEventLifecycleListener.projectTriggered(GerritEvent, Job)
.void
fireTriggerScanDone()
Fires the eventGerritEventLifecycleListener.triggerScanDone(GerritEvent)
.void
fireTriggerScanStarting()
Fires the eventGerritEventLifecycleListener.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
-
-
-
-
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 classcom.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 interfaceGerritEventLifecycle
- 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 interfaceGerritEventLifecycle
- 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 interfaceGerritEventLifecycle
- 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 eventGerritEventLifecycleListener.triggerScanStarting(GerritEvent)
.- Specified by:
fireTriggerScanStarting
in interfaceGerritEventLifecycle
-
fireTriggerScanDone
public void fireTriggerScanDone()
Description copied from interface:GerritEventLifecycle
Fires the eventGerritEventLifecycleListener.triggerScanDone(GerritEvent)
.- Specified by:
fireTriggerScanDone
in interfaceGerritEventLifecycle
-
fireProjectTriggered
public void fireProjectTriggered(Job project)
Description copied from interface:GerritEventLifecycle
Fires the eventGerritEventLifecycleListener.projectTriggered(GerritEvent, Job)
.- Specified by:
fireProjectTriggered
in interfaceGerritEventLifecycle
- Parameters:
project
- the project that is triggered.
-
fireBuildStarted
public void fireBuildStarted(Run build)
Description copied from interface:GerritEventLifecycle
Fires the eventGerritEventLifecycleListener.buildStarted(GerritEvent, Run)
.- Specified by:
fireBuildStarted
in interfaceGerritEventLifecycle
- Parameters:
build
- the build that has started.
-
fireBuildCompleted
public void fireBuildCompleted(Run build)
Description copied from interface:GerritEventLifecycle
Fires the eventGerritEventLifecycleListener.buildCompleted(GerritEvent, Run)
.- Specified by:
fireBuildCompleted
in interfaceGerritEventLifecycle
- Parameters:
build
- the build that is completed.
-
fireAllBuildsCompleted
public void fireAllBuildsCompleted()
Description copied from interface:GerritEventLifecycle
Fires the eventGerritEventLifecycleListener.allBuildsCompleted(GerritEvent)
.- Specified by:
fireAllBuildsCompleted
in interfaceGerritEventLifecycle
-
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.
-
-