com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model
Class BuildMemory.MemoryImprint

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildMemory.MemoryImprint
Enclosing class:
BuildMemory

public static class BuildMemory.MemoryImprint
extends java.lang.Object

A holder for all builds triggered by one event.


Nested Class Summary
static class BuildMemory.MemoryImprint.Entry
          A project-build entry in the list of a MemoryImprint.
 
Constructor Summary
BuildMemory.MemoryImprint(PatchsetCreated event)
          Constructor.
BuildMemory.MemoryImprint(PatchsetCreated event, hudson.model.AbstractProject project)
          Constructor.
 
Method Summary
 BuildsStartedStats getBuildsStartedStats()
          Gets the statistics about builds started.
 BuildMemory.MemoryImprint.Entry[] getEntries()
          A list of Project-Build tuple entries.
 PatchsetCreated getEvent()
          The event.
 java.lang.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(hudson.model.AbstractProject project)
          Resets the build info for the project.
protected  void set(hudson.model.AbstractProject project)
          Adds the project to the list.
protected  void set(hudson.model.AbstractProject project, hudson.model.AbstractBuild build)
          Sets the build to a project or adds the project to the list.
 boolean whereAllBuildsSuccessful()
          Tells if all builds in the memory were successful.
 boolean whereAnyBuildsFailed()
          Returns if any started and completed build has the result Result.FAILURE.
 boolean whereAnyBuildsUnstable()
          Returns if any started and completed build has the result Result.UNSTABLE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildMemory.MemoryImprint

public BuildMemory.MemoryImprint(PatchsetCreated event)
Constructor.

Parameters:
event - the event.

BuildMemory.MemoryImprint

public BuildMemory.MemoryImprint(PatchsetCreated event,
                                 hudson.model.AbstractProject project)
Constructor.

Parameters:
event - the event.
project - the first project.
Method Detail

getEvent

public PatchsetCreated 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(hudson.model.AbstractProject project,
                   hudson.model.AbstractBuild 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(hudson.model.AbstractProject project)
Adds the project to the list.

Parameters:
project - the project.

reset

protected void reset(hudson.model.AbstractProject project)
Resets the build info for the project. If the project doesn't exist it would be as if calling set(hudson.model.AbstractProject).

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 java.lang.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.

whereAllBuildsSuccessful

public boolean whereAllBuildsSuccessful()
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.

whereAnyBuildsFailed

public boolean whereAnyBuildsFailed()
Returns if any started and completed build has the result Result.FAILURE.

Returns:
true if it is so.

whereAnyBuildsUnstable

public boolean whereAnyBuildsUnstable()
Returns if any started and completed build has the result Result.UNSTABLE.

Returns:
true if it is so.


Copyright © 2004-2012. All Rights Reserved.