|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildMemory
public class BuildMemory
Keeps track of what builds have been triggered and if all builds are done for specific events.
Nested Class Summary | |
---|---|
static class |
BuildMemory.MemoryImprint
A holder for all builds triggered by one event. |
static class |
BuildMemory.PatchSetKey
The Key to use to map events and builds. |
Constructor Summary | |
---|---|
BuildMemory()
|
Method Summary | |
---|---|
BuildMemory.PatchSetKey |
completed(PatchsetCreated event,
hudson.model.AbstractBuild build)
Sets the memory that a build is completed for an event. |
void |
forget(BuildMemory.PatchSetKey key)
Removes the memory for the provided key. |
List<hudson.model.AbstractBuild> |
getBuilds(BuildMemory.PatchSetKey key)
Returns all started builds in memory for the given key. |
BuildsStartedStats |
getBuildsStartedStats(BuildMemory.PatchSetKey key)
Gets the statistics of started builds for a specific memory imprint. |
BuildMemory.MemoryImprint |
getMemoryImprint(BuildMemory.PatchSetKey key)
Gets the memory of a specific key. |
String |
getStatusReport(BuildMemory.PatchSetKey key)
Returns the status report for the given MemoryImprint. |
boolean |
isAllBuildsCompleted(BuildMemory.PatchSetKey key)
Tells if all triggered builds have started for a specific memory imprint. |
boolean |
isAllBuildsCompleted(PatchsetCreated event)
Tells if all triggered builds have started for a specific event. |
boolean |
isAllBuildsStarted(BuildMemory.PatchSetKey key)
Tells if all triggered builds have started for a specific memory imprint. |
boolean |
isAllBuildsStarted(PatchsetCreated event)
Tells if all triggered builds have started for a specific event. |
boolean |
isBuilding(PatchsetCreated event)
Checks if the provided event exists in this memory. |
boolean |
isBuilding(PatchsetCreated event,
hudson.model.AbstractProject project)
Checks in memory if the project is building the event. |
BuildMemory.PatchSetKey |
retriggered(PatchsetCreated event,
hudson.model.AbstractProject project,
List<hudson.model.AbstractBuild> otherBuilds)
Adds a new memory about a build that has been retriggered. |
BuildMemory.PatchSetKey |
started(PatchsetCreated event,
hudson.model.AbstractBuild build)
Sets the memory that a build has started for an event. |
BuildMemory.PatchSetKey |
triggered(PatchsetCreated event,
hudson.model.AbstractProject project)
Adds a new memory about a build that has been/will be triggered. |
void |
updateTriggerContext(BuildMemory.PatchSetKey key,
GerritCause cause,
hudson.model.AbstractBuild r)
Updates the TriggerContext for the provided key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BuildMemory()
Method Detail |
---|
public BuildMemory.MemoryImprint getMemoryImprint(BuildMemory.PatchSetKey key)
key
- the key
public boolean isAllBuildsCompleted(PatchsetCreated event)
isAllBuildsCompleted(PatchSetKey)
since an internal key needs to be created.
event
- the event.
public boolean isAllBuildsCompleted(BuildMemory.PatchSetKey key)
key
- the key to the memory.
public BuildsStartedStats getBuildsStartedStats(BuildMemory.PatchSetKey key)
key
- the memory key.
public String getStatusReport(BuildMemory.PatchSetKey key)
key
- the key to the memory.
BuildMemory.MemoryImprint.getStatusReport()
public boolean isAllBuildsStarted(PatchsetCreated event)
isAllBuildsStarted(PatchSetKey)
since an internal key needs to be created.
event
- the event.
public boolean isAllBuildsStarted(BuildMemory.PatchSetKey key)
key
- the key to the memory.
public BuildMemory.PatchSetKey completed(PatchsetCreated event, hudson.model.AbstractBuild build)
event
- the eventbuild
- the build.
public BuildMemory.PatchSetKey started(PatchsetCreated event, hudson.model.AbstractBuild build)
event
- the event.build
- the build.
public BuildMemory.PatchSetKey triggered(PatchsetCreated event, hudson.model.AbstractProject project)
event
- the event that triggered it.project
- the project that was triggered.
public BuildMemory.PatchSetKey retriggered(PatchsetCreated event, hudson.model.AbstractProject project, List<hudson.model.AbstractBuild> otherBuilds)
event
- the event to be retriggered.project
- the project that has been retriggered.otherBuilds
- the list of other builds that was in the "old" memory.
public void forget(BuildMemory.PatchSetKey key)
key
- the key to the memory.public void updateTriggerContext(BuildMemory.PatchSetKey key, GerritCause cause, hudson.model.AbstractBuild r)
TriggerContext
for the provided key.
The cause and build is the "focal point" for the update, but all memory entities will be updated,
but only the current context will be TriggerContext.setThisBuild(hudson.model.AbstractBuild)
updated.
key
- the key to have as "focus" for the update.cause
- the cause.r
- the build the cause is in.public boolean isBuilding(PatchsetCreated event, hudson.model.AbstractProject project)
event
- the event.project
- the project.
public boolean isBuilding(PatchsetCreated event)
event
- the event to look for.
public List<hudson.model.AbstractBuild> getBuilds(BuildMemory.PatchSetKey key)
key
- the key for the memory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |