hudson.plugins.pmd.util
Class AbstractResultAction<T>

java.lang.Object
  extended by hudson.plugins.pmd.util.AbstractResultAction<T>
Type Parameters:
T - type of the result of this action
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, ResultAction<T>, java.io.Serializable, org.kohsuke.stapler.StaplerProxy
Direct Known Subclasses:
PmdResultAction

public abstract class AbstractResultAction<T>
extends java.lang.Object
implements org.kohsuke.stapler.StaplerProxy, hudson.model.HealthReportingAction, ResultAction<T>

Controls the live cycle of Hudson results. This action persists the results of a build and displays them on the build page. The actual visualization of the results is defined in the matching summary.jelly file.

Moreover, this class renders the results trend.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
AbstractResultAction(hudson.model.AbstractBuild<?,?> owner, HealthReportBuilder healthReportBuilder, T result)
          Creates a new instance of AbstractResultAction.
 
Method Summary
protected abstract  org.jfree.chart.JFreeChart createChart(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Creates the chart for this action.
 void doGraph(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for the result trend.
 void doGraphMap(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for the result trend.
 hudson.model.HealthReport getBuildHealth()
          
protected abstract  int getHealthCounter()
          Returns the health counter of this result.
 HealthReportBuilder getHealthReportBuilder()
          Returns the associated health report builder.
 java.lang.String getIconFileName()
          
protected abstract  java.lang.String getIconUrl()
          Returns the file name URL of the icon.
 hudson.model.AbstractBuild<?,?> getOwner()
          Returns the associated build of this action.
 T getResult()
          Returns the current result of this action.
 java.lang.Object getTarget()
          
 void setResult(T result)
          Sets the result for this build.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.Action
getDisplayName, getUrlName
 
Methods inherited from interface hudson.plugins.pmd.util.ResultAction
getPreviousResultAction, hasPreviousResultAction
 
Methods inherited from interface hudson.model.Action
getDisplayName, getUrlName
 

Constructor Detail

AbstractResultAction

public AbstractResultAction(hudson.model.AbstractBuild<?,?> owner,
                            HealthReportBuilder healthReportBuilder,
                            T result)
Creates a new instance of AbstractResultAction.

Parameters:
owner - the associated build of this action
healthReportBuilder - health builder to use
result - the result of the action
Method Detail

getHealthReportBuilder

public final HealthReportBuilder getHealthReportBuilder()
Returns the associated health report builder.

Specified by:
getHealthReportBuilder in interface ResultAction<T>
Returns:
the associated health report builder

getBuildHealth

public final hudson.model.HealthReport getBuildHealth()

Specified by:
getBuildHealth in interface hudson.model.HealthReportingAction

getHealthCounter

protected abstract int getHealthCounter()
Returns the health counter of this result.

Returns:
the health counter of this result.

getOwner

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

Returns:
the associated build of this action

getTarget

public final java.lang.Object getTarget()

Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy

getResult

public final T getResult()
Returns the current result of this action.

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

setResult

public final void setResult(T result)
Sets the result for this build.

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

getIconFileName

public java.lang.String getIconFileName()

Specified by:
getIconFileName in interface hudson.model.Action

getIconUrl

protected abstract java.lang.String getIconUrl()
Returns the file name URL of the icon.

Returns:
the file name URL of the icon.

doGraph

public final void doGraph(org.kohsuke.stapler.StaplerRequest request,
                          org.kohsuke.stapler.StaplerResponse response)
                   throws java.io.IOException
Generates a PNG image for the result trend.

Specified by:
doGraph in interface ResultAction<T>
Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error

doGraphMap

public final void doGraphMap(org.kohsuke.stapler.StaplerRequest request,
                             org.kohsuke.stapler.StaplerResponse response)
                      throws java.io.IOException
Generates a PNG image for the result trend.

Specified by:
doGraphMap in interface ResultAction<T>
Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error

createChart

protected abstract org.jfree.chart.JFreeChart createChart(org.kohsuke.stapler.StaplerRequest request,
                                                          org.kohsuke.stapler.StaplerResponse response)
Creates the chart for this action.

Parameters:
request - Stapler request
response - Stapler response
Returns:
the chart for this action.


Copyright © 2008. All Rights Reserved.