hudson.plugins.analysis.core
Class MavenResultAction<T extends BuildResult>

java.lang.Object
  extended by hudson.plugins.analysis.core.MavenResultAction<T>
Type Parameters:
T - type of the build result
All Implemented Interfaces:
hudson.maven.AggregatableAction, hudson.maven.MavenAggregatedReport, hudson.model.Action, hudson.model.ModelObject, ResultAction<T>, org.kohsuke.stapler.StaplerProxy

public abstract class MavenResultAction<T extends BuildResult>
extends Object
implements org.kohsuke.stapler.StaplerProxy, hudson.maven.AggregatableAction, hudson.maven.MavenAggregatedReport, ResultAction<T>

Base class for Maven aggregated build reports.

Since:
1.20
Author:
Ulli Hafner

Constructor Summary
MavenResultAction(AbstractResultAction<T> delegate, String defaultEncoding, String pluginName)
          Creates a new instance of MavenResultAction.
 
Method Summary
protected  ParserResult aggregate(T existingResult, T additionalResult)
          Aggregates the results in a new instance of ParserResult.
protected abstract  T createResult(T existingResult, T additionalResult)
          Creates a new build result that contains the aggregated results.
 hudson.model.AbstractBuild<?,?> getBuild()
          Returns the associated build of this action.
 hudson.model.HealthReport getBuildHealth()
          Returns the health of this action.
 String getDefaultEncoding()
          Returns the default encoding.
 String getDisplayName()
          
 AbstractHealthDescriptor getHealthDescriptor()
          Gets the associated health descriptor.
 String getIconFileName()
          
abstract  Class<? extends MavenResultAction<T>> getIndividualActionType()
          
 String getLargeImageName()
          Returns the URL of the 48x48 image used in the build summary.
 String getLog()
          Returns all logging statements of this action that couldn't be printed so far.
 hudson.model.AbstractBuild<?,?> getOwner()
          Returns the associated build of this action.
 T getResult()
          Returns the current result of this action.
 String getSmallImageName()
          Returns the URL of the 24x24 image used in the build link.
 Object getTarget()
           
 String getTooltip(int numberOfItems)
          Returns the tooltip for the specified number of items.
 ToolTipProvider getToolTipProvider()
          Returns the associated tool tip provider.
 String getUrlName()
          
 boolean hasLargeImage()
          Returns whether a large image is defined.
 boolean isSuccessful()
          Returns whether this build is successful with respect to the HealthDescriptor of this action.
 void setResult(T additionalResult)
          Sets the result for this build.
 void update(Map<hudson.maven.MavenModule,List<hudson.maven.MavenBuild>> moduleBuilds, hudson.maven.MavenBuild newBuild)
          Called whenever a new module build is completed, to update the aggregated report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.maven.AggregatableAction
createAggregatedAction
 
Methods inherited from interface hudson.maven.MavenAggregatedReport
getProjectAction
 

Constructor Detail

MavenResultAction

public MavenResultAction(AbstractResultAction<T> delegate,
                         String defaultEncoding,
                         String pluginName)
Creates a new instance of MavenResultAction.

Parameters:
delegate - result action for freestyle jobs that will do the main of the work
defaultEncoding - the default encoding to be used when reading and parsing files
pluginName - name of the plug-in
Method Detail

getIndividualActionType

public abstract Class<? extends MavenResultAction<T>> getIndividualActionType()

Specified by:
getIndividualActionType in interface hudson.maven.MavenAggregatedReport

getSmallImageName

public String getSmallImageName()
Returns the URL of the 24x24 image used in the build link.

Returns:
the URL of the image
Since:
1.42

createResult

protected abstract T createResult(@CheckForNull
                                  T existingResult,
                                  T additionalResult)
Creates a new build result that contains the aggregated results.

Parameters:
existingResult - an already existing result, might be null for the first aggregation
additionalResult - the additional result to be aggregated with the existing result
Returns:
the created result

update

public void update(Map<hudson.maven.MavenModule,List<hudson.maven.MavenBuild>> moduleBuilds,
                   hudson.maven.MavenBuild newBuild)
Called whenever a new module build is completed, to update the aggregated report. When multiple builds complete simultaneously, Jenkins serializes the execution of this method, so this method needs not be concurrency-safe.

Specified by:
update in interface hudson.maven.MavenAggregatedReport
Parameters:
moduleBuilds - Same as MavenModuleSet.getModuleBuilds() but provided for convenience and efficiency.
newBuild - Newly completed build.

aggregate

protected ParserResult aggregate(@CheckForNull
                                 T existingResult,
                                 T additionalResult)
Aggregates the results in a new instance of ParserResult.

Parameters:
existingResult - an already existing result, might be null for the first aggregation
additionalResult - the additional result to be aggregated with the existing result
Returns:
the aggregated result

getLog

public String getLog()
Returns all logging statements of this action that couldn't be printed so far.

Returns:
the logging statements

getDefaultEncoding

public String getDefaultEncoding()
Returns the default encoding.

Returns:
the default encoding

hasLargeImage

public boolean hasLargeImage()
Returns whether a large image is defined.

Returns:
true if a large image is defined, false otherwise. If no large image is defined, then the attribute icon must to be provided in jelly tag summary.
Since:
1.41

getLargeImageName

public String getLargeImageName()
Returns the URL of the 48x48 image used in the build summary.

Returns:
the URL of the image
Since:
1.41

getIconFileName

public String getIconFileName()

Specified by:
getIconFileName in interface hudson.model.Action

getDisplayName

public String getDisplayName()

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getUrlName

public String getUrlName()

Specified by:
getUrlName in interface hudson.model.Action

setResult

public void setResult(T additionalResult)
Description copied from interface: ResultAction
Sets the result for this build.

Specified by:
setResult in interface ResultAction<T extends BuildResult>
Parameters:
additionalResult - the result to set

getResult

public T getResult()
Description copied from interface: ResultAction
Returns the current result of this action.

Specified by:
getResult in interface ResultAction<T extends BuildResult>
Returns:
the current result

getOwner

public hudson.model.AbstractBuild<?,?> getOwner()
Returns the associated build of this action.

Returns:
the associated build of this action

getBuildHealth

public final hudson.model.HealthReport getBuildHealth()
Returns the health of this action.

Returns:
the health of this action

getToolTipProvider

public ToolTipProvider getToolTipProvider()
Description copied from interface: ResultAction
Returns the associated tool tip provider.

Specified by:
getToolTipProvider in interface ResultAction<T extends BuildResult>
Returns:
the tool tip provider

getBuild

public final hudson.model.AbstractBuild<?,?> getBuild()
Description copied from interface: ResultAction
Returns the associated build of this action.

Specified by:
getBuild in interface ResultAction<T extends BuildResult>
Returns:
the associated build of this action

getTarget

public final Object getTarget()
Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy

getTooltip

public String getTooltip(int numberOfItems)
Returns the tooltip for the specified number of items.

Parameters:
numberOfItems - the number of items to display the tooltip for
Returns:
the tooltip for the specified items

isSuccessful

public boolean isSuccessful()
Description copied from interface: ResultAction
Returns whether this build is successful with respect to the HealthDescriptor of this action.

Specified by:
isSuccessful in interface ResultAction<T extends BuildResult>
Returns:
true if the build is successful, false if the build has been set to Result.UNSTABLE or Result.FAILURE by this action.

getHealthDescriptor

public AbstractHealthDescriptor getHealthDescriptor()
Description copied from interface: ResultAction
Gets the associated health descriptor.

Specified by:
getHealthDescriptor in interface ResultAction<T extends BuildResult>
Returns:
the health descriptor


Copyright © 2004-2012 Hudson. All Rights Reserved.