|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.listeners.RunListener<hudson.model.AbstractBuild>
com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener
@Extension(ordinal=10003.0) public class ToGerritRunListener
The Big RunListener in charge of coordinating build results and reporting back to Gerrit.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary | |
---|---|
static int |
ORDINAL
The ordering of this extension. |
Fields inherited from class hudson.model.listeners.RunListener |
---|
LISTENERS, targetType |
Constructor Summary | |
---|---|
ToGerritRunListener()
Default Constructor. |
Method Summary | |
---|---|
protected void |
cleanUpGerritCauses(GerritCause firstFound,
hudson.model.AbstractBuild build)
Workaround for builds that are triggered by the same Gerrit cause but multiple times in the same quiet period. |
protected String |
getExpandedContent(hudson.FilePath path,
hudson.EnvVars envVars)
Returns the expanded file contents using the provided environment variables. |
static ToGerritRunListener |
getInstance()
Returns the registered instance of this class from the list of all listeners. |
protected hudson.FilePath[] |
getMatchingWorkspaceFiles(hudson.FilePath ws,
String filepath)
Searches the workspace for files matching the filepath glob. |
boolean |
isBuilding(hudson.model.AbstractProject project,
GerritTriggeredEvent event)
Checks the memory if the project is currently building the event. |
boolean |
isBuilding(GerritTriggeredEvent event)
Checks the memory if the event is building. |
void |
onCompleted(hudson.model.AbstractBuild r,
hudson.model.TaskListener listener)
|
void |
onRetriggered(hudson.model.AbstractProject project,
GerritTriggeredEvent event,
List<hudson.model.AbstractBuild> otherBuilds)
Called just before a build is scheduled by the user to retrigger. |
void |
onStarted(hudson.model.AbstractBuild r,
hudson.model.TaskListener listener)
|
void |
onTriggered(hudson.model.AbstractProject project,
GerritTriggeredEvent event)
Called just before a build is scheduled by the trigger. |
protected void |
setThisBuild(hudson.model.AbstractBuild r)
Updates all GerritCause s
TriggerContext.thisBuild
in the build. |
protected void |
updateTriggerContexts(hudson.model.AbstractBuild r)
Updates the TriggerContext s for all the
GerritCause s in the build. |
Methods inherited from class hudson.model.listeners.RunListener |
---|
all, fireCompleted, fireDeleted, fireFinalized, fireStarted, onDeleted, onFinalized, register, setUpEnvironment, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ORDINAL
Constructor Detail |
---|
public ToGerritRunListener()
Method Detail |
---|
public static ToGerritRunListener getInstance()
public void onCompleted(hudson.model.AbstractBuild r, hudson.model.TaskListener listener)
onCompleted
in class hudson.model.listeners.RunListener<hudson.model.AbstractBuild>
public void onStarted(hudson.model.AbstractBuild r, hudson.model.TaskListener listener)
onStarted
in class hudson.model.listeners.RunListener<hudson.model.AbstractBuild>
protected void updateTriggerContexts(hudson.model.AbstractBuild r)
TriggerContext
s for all the
GerritCause
s in the build.
r
- the build.BuildMemory.updateTriggerContext(
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritCause,
hudson.model.AbstractBuild)
protected void setThisBuild(hudson.model.AbstractBuild r)
GerritCause
s
TriggerContext.thisBuild
in the build.
r
- the build to update.protected void cleanUpGerritCauses(GerritCause firstFound, hudson.model.AbstractBuild build)
firstFound
- the cause first returned by Run.getCause(Class)
.build
- the build to clean up.public void onTriggered(hudson.model.AbstractProject project, GerritTriggeredEvent event)
project
- the project that will be built.event
- the event that caused the build to be scheduled.public void onRetriggered(hudson.model.AbstractProject project, GerritTriggeredEvent event, List<hudson.model.AbstractBuild> otherBuilds)
project
- the project.event
- the event.otherBuilds
- the list of other builds in the previous context.public boolean isBuilding(hudson.model.AbstractProject project, GerritTriggeredEvent event)
project
- the project.event
- the event.
BuildMemory.isBuilding(GerritTriggeredEvent, hudson.model.AbstractProject)
public boolean isBuilding(GerritTriggeredEvent event)
event
- the event.
BuildMemory.isBuilding(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.GerritTriggeredEvent)
protected hudson.FilePath[] getMatchingWorkspaceFiles(hudson.FilePath ws, String filepath) throws IOException, InterruptedException
workspace
for files matching the filepath
glob.
ws
- The workspacefilepath
- The filepath glob pattern
FilePath
s. Guaranteed to be non-null.
IOException
- if an error occurs while reading the workspace
InterruptedException
- if an error occurs while reading the workspaceprotected String getExpandedContent(hudson.FilePath path, hudson.EnvVars envVars) throws IOException, InterruptedException
null
will be returned if the path does not exist.
path
- The file path being read.envVars
- The environment variables to use during expansion.
null
if it does not exist.
IOException
- if an error occurs while reading the file
InterruptedException
- if an error occurs while checking the status of the file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |