public class BuildMemory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BuildMemory.MemoryImprint
A holder for all builds triggered by one event.
|
Constructor and Description |
---|
BuildMemory() |
Modifier and Type | Method and Description |
---|---|
void |
completed(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractBuild build)
Sets the memory that a build is completed for an event.
|
void |
forget(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Removes the memory for the event.
|
List<hudson.model.AbstractBuild> |
getBuilds(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Returns all started builds in memory for the event.
|
BuildsStartedStats |
getBuildsStartedStats(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Gets the statistics of started builds for a specific memory imprint.
|
BuildMemory.MemoryImprint |
getMemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Gets the memory of a specific event.
|
String |
getStatusReport(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Returns the status report for the given MemoryImprint.
|
boolean |
isAllBuildsCompleted(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Tells if all triggered builds have started for a specific memory imprint.
|
boolean |
isAllBuildsStarted(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Tells if all triggered builds have started for a specific memory imprint.
|
boolean |
isBuilding(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Checks if the provided event exists in this memory.
|
boolean |
isBuilding(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractProject project)
Checks in memory if the project is building the event.
|
boolean |
isTriggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractProject project)
Checks in memory if the project has been triggered for the event.
|
void |
retriggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractProject project,
List<hudson.model.AbstractBuild> otherBuilds)
Adds a new memory about a build that has been retriggered.
|
void |
setEntryFailureMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractBuild r,
String failureMessage)
Records the failure message for the given build.
|
void |
started(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractBuild build)
Sets the memory that a build has started for an event.
|
void |
triggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.AbstractProject project)
Adds a new memory about a build that has been/will be triggered.
|
void |
updateTriggerContext(GerritCause cause,
hudson.model.AbstractBuild r)
Updates the
TriggerContext for the event. |
public BuildMemory.MemoryImprint getMemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public boolean isAllBuildsCompleted(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public BuildsStartedStats getBuildsStartedStats(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public String getStatusReport(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.BuildMemory.MemoryImprint.getStatusReport()
public boolean isAllBuildsStarted(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public void completed(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.AbstractBuild build)
event
- the eventbuild
- the build.public void started(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.AbstractBuild build)
event
- the event.build
- the build.public void triggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.AbstractProject project)
event
- the event that triggered it.project
- the project that was triggered.public void retriggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent 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(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public void updateTriggerContext(GerritCause cause, hudson.model.AbstractBuild r)
TriggerContext
for the event. 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.cause
- the cause.r
- the build the cause is in.public boolean isTriggered(@Nonnull com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, @Nonnull hudson.model.AbstractProject project)
event
- the event.project
- the project.public boolean isBuilding(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.AbstractProject project)
event
- the event.project
- the project.public boolean isBuilding(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event to look for.public List<hudson.model.AbstractBuild> getBuilds(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public void setEntryFailureMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.AbstractBuild r, String failureMessage)
event
- the event.r
- the build that caused the failure.failureMessage
- the failure messageCopyright © 2004-2015. All Rights Reserved.