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 |
cancelled(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Job project)
Sets the status if a project to completed when queue is cancelled.
|
void |
completed(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Run 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.Run> |
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.Job project)
Checks in memory if the project is building the event.
|
boolean |
isTriggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Job project)
Checks in memory if the project has been triggered for the event.
|
BuildMemoryReport |
report()
Creates a snapshot clone of the current coordination memory status.
|
void |
retriggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Job project,
List<hudson.model.Run> otherBuilds)
Adds a new memory about a build that has been retriggered.
|
void |
setEntryCustomUrl(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Run r,
String customUrl)
Records a custom URL for the given build.
|
void |
setEntryFailureMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Run r,
String failureMessage)
|
void |
setEntryUnsuccessfulMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Run r,
String unsuccessfulMessage)
Records the unsuccessful message for the given build.
|
void |
started(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event,
hudson.model.Run 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.Job project)
Adds a new memory about a build that has been/will be triggered.
|
void |
updateTriggerContext(GerritCause cause,
hudson.model.Run 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.Run build)
event
- the eventbuild
- the build.public void started(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Run build)
event
- the event.build
- the build.public void triggered(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Job 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.Job project, List<hudson.model.Run> 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 cancelled(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Job project)
event
- the event to be retriggered.project
- the project that has been retriggered.public void forget(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public void updateTriggerContext(GerritCause cause, hudson.model.Run 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.Run)
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.Job project)
event
- the event.project
- the project.public boolean isBuilding(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Job 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.Run> getBuilds(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
event
- the event.public void setEntryCustomUrl(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Run r, String customUrl)
event
- the event.r
- the build that caused the failure.customUrl
- the URL.public void setEntryUnsuccessfulMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Run r, String unsuccessfulMessage)
event
- the event.r
- the build that caused the failure.unsuccessfulMessage
- the unsuccessful message@Deprecated public void setEntryFailureMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, hudson.model.Run r, String failureMessage)
setEntryUnsuccessfulMessage(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent, hudson.model.Run, java.lang.String)
event
- the event.r
- the build that caused the failure.failureMessage
- the failure message@Nonnull public BuildMemoryReport report()
Copyright © 2016–2017. All rights reserved.