Class BuildMemory.MemoryImprint
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildMemory.MemoryImprint
-
- Enclosing class:
- BuildMemory
public static class BuildMemory.MemoryImprint extends Object
A holder for all builds triggered by one event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BuildMemory.MemoryImprint.Entry
A project-build entry in the list of a MemoryImprint.
-
Constructor Summary
Constructors Constructor Description MemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Constructor.MemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, Job project)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areAllBuildResultsSkipped()
If all entry's results are configured to be skipped.BuildsStartedStats
getBuildsStartedStats()
Gets the statistics about builds started.BuildMemory.MemoryImprint.Entry[]
getEntries()
A list of Project-Build tuple entries.com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent
getEvent()
The event.String
getStatusReport()
Returns a string describing the projects and builds status in this memory.boolean
isAllBuildsCompleted()
Tells if all builds have Completed.boolean
isAllBuildsSet()
Tells if all builds have a value (not null).protected void
reset(Job project)
Resets the build info for the project.protected void
set(Job project)
Adds the project to the list.protected void
set(Job project, Run build)
Sets the build to a project or adds the project to the list.boolean
wereAllBuildsNotBuilt()
Tells if all builds in the memory were not built.boolean
wereAllBuildsSuccessful()
Tells if all builds in the memory were successful.boolean
wereAnyBuildsAborted()
Returns if any started and completed build has the resultResult.ABORTED
.boolean
wereAnyBuildsFailed()
Returns if any started and completed build has the resultResult.FAILURE
.boolean
wereAnyBuildsUnstable()
Returns if any started and completed build has the resultResult.UNSTABLE
.
-
-
-
Constructor Detail
-
MemoryImprint
public MemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Constructor.- Parameters:
event
- the event.
-
MemoryImprint
public MemoryImprint(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event, Job project)
Constructor.- Parameters:
event
- the event.project
- the first project.
-
-
Method Detail
-
getEvent
public com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent getEvent()
The event.- Returns:
- the event.
-
getEntries
public BuildMemory.MemoryImprint.Entry[] getEntries()
A list of Project-Build tuple entries.- Returns:
- the memory entries.
-
set
protected void set(Job project, Run build)
Sets the build to a project or adds the project to the list.- Parameters:
project
- the project.build
- the build.
-
set
protected void set(Job project)
Adds the project to the list.- Parameters:
project
- the project.
-
reset
protected void reset(Job project)
Resets the build info for the project. If the project doesn't exist it would be as if callingset(hudson.model.Job)
.- Parameters:
project
- the project to reset.
-
isAllBuildsSet
public boolean isAllBuildsSet()
Tells if all builds have a value (not null).- Returns:
- true if it is so.
-
isAllBuildsCompleted
public boolean isAllBuildsCompleted()
Tells if all builds have Completed.- Returns:
- true if it is so.
-
getStatusReport
public String getStatusReport()
Returns a string describing the projects and builds status in this memory. Good for logging.- Returns:
- a report.
-
getBuildsStartedStats
public BuildsStartedStats getBuildsStartedStats()
Gets the statistics about builds started.- Returns:
- the stats.
-
areAllBuildResultsSkipped
public boolean areAllBuildResultsSkipped()
If all entry's results are configured to be skipped.- Returns:
- true if so.
- See Also:
wereAllBuildsSuccessful()
-
wereAllBuildsSuccessful
public boolean wereAllBuildsSuccessful()
Tells if all builds in the memory were successful.- Returns:
- true if it is so, false if not all builds have started or not completed or have any different result
than
Result.SUCCESS
.
-
wereAnyBuildsFailed
public boolean wereAnyBuildsFailed()
Returns if any started and completed build has the resultResult.FAILURE
.- Returns:
- true if it is so.
-
wereAnyBuildsUnstable
public boolean wereAnyBuildsUnstable()
Returns if any started and completed build has the resultResult.UNSTABLE
.- Returns:
- true if it is so.
-
wereAllBuildsNotBuilt
public boolean wereAllBuildsNotBuilt()
Tells if all builds in the memory were not built.- Returns:
- true if it is so, false if not all builds have started or not completed or have any different result
than
Result.NOT_BUILT
.
-
wereAnyBuildsAborted
public boolean wereAnyBuildsAborted()
Returns if any started and completed build has the resultResult.ABORTED
.- Returns:
- true if it is so.
-
-