hudson.plugins.analysis.graph
Class GraphConfigurationView

java.lang.Object
  extended by hudson.plugins.analysis.graph.GraphConfigurationView
All Implemented Interfaces:
hudson.model.ModelObject
Direct Known Subclasses:
DefaultGraphConfigurationView, UserGraphConfigurationView

public abstract class GraphConfigurationView
extends Object
implements hudson.model.ModelObject

Configuration properties of a trend graph.


Constructor Summary
GraphConfigurationView(GraphConfiguration configuration, hudson.model.AbstractProject<?,?> project, String key, BuildHistory buildHistory)
          Creates a new instance of GraphConfigurationView.
 
Method Summary
protected static File createDefaultsFile(hudson.model.AbstractProject<?,?> project, String pluginName)
          Creates a file with for the default values.
 void doSave(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Saves the configured values.
 List<? extends BuildResultGraph> getAvailableGraphs()
          Returns the list of available graphs.
 int getBuildCount()
          Returns the number of builds to consider.
 String getBuildCountString()
          Returns the number of builds to consider.
 int getDayCount()
          Returns the number of days to consider.
 String getDayCountString()
          Returns the number of days to consider.
abstract  String getDescription()
          Returns the description for this view.
 Object getDynamic(String graphId, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          This method will be called by Stapler if an example image for the specified graph should be rendered.
 hudson.util.Graph getGraphRenderer()
          Returns the graph renderer of the current graph.
 hudson.util.Graph getGraphRenderer(BuildResultGraph graph, String url)
          Returns the graph renderer of the specified graph.
 hudson.util.Graph getGraphRenderer(String url)
          Returns the graph renderer of the current graph.
 BuildResultGraph getGraphType()
          Returns the type of the graph.
 AbstractHealthDescriptor getHealthDescriptor()
          Returns the current health descriptor.
 int getHeight()
          Returns the height.
 String getKey()
          Returns the key of this graph.
 hudson.model.AbstractProject<?,?> getOwner()
          Returns the project.
 long getTimestamp()
          Returns the time stamp of the associated build.
 boolean getUseBuildDateAsDomain()
          Returns whether the build date or the build number should be used as domain.
 int getWidth()
          Returns the width.
 boolean hasMeaningfulGraph()
          Checks whether a meaningful graph is available.
 boolean isDeactivated()
          Returns whether the trend graph completely is deactivated.
 boolean isHealthGraphAvailable()
          Checks if the health graph is available.
 boolean isVisible()
          Returns whether the trend graph is visible or not.
protected abstract  void persistValue(String value, String pluginName, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Persists the configured values.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.model.ModelObject
getDisplayName
 

Constructor Detail

GraphConfigurationView

public GraphConfigurationView(GraphConfiguration configuration,
                              hudson.model.AbstractProject<?,?> project,
                              String key,
                              BuildHistory buildHistory)
Creates a new instance of GraphConfigurationView.

Parameters:
configuration - the graph configuration
project - the owning project to configure the graphs for
key - unique key of this graph
buildHistory - the build history for this project
Method Detail

createDefaultsFile

protected static File createDefaultsFile(hudson.model.AbstractProject<?,?> project,
                                         String pluginName)
Creates a file with for the default values.

Parameters:
project - the project used as directory for the file
pluginName - the name of the plug-in
Returns:
the created file

getAvailableGraphs

public List<? extends BuildResultGraph> getAvailableGraphs()
Returns the list of available graphs.

Returns:
the list of available graphs

getOwner

public hudson.model.AbstractProject<?,?> getOwner()
Returns the project.

Returns:
the project

getKey

public String getKey()
Returns the key of this graph.

Returns:
the key

getDescription

public abstract String getDescription()
Returns the description for this view.

Returns:
the description for this view

doSave

public void doSave(org.kohsuke.stapler.StaplerRequest request,
                   org.kohsuke.stapler.StaplerResponse response)
Saves the configured values. Subclasses need to implement the actual persistence.

Parameters:
request - Stapler request
response - Stapler response

hasMeaningfulGraph

public boolean hasMeaningfulGraph()
Checks whether a meaningful graph is available.

Returns:
true, if there is such a graph

persistValue

protected abstract void persistValue(String value,
                                     String pluginName,
                                     org.kohsuke.stapler.StaplerRequest request,
                                     org.kohsuke.stapler.StaplerResponse response)
                              throws IOException
Persists the configured values.

Parameters:
value - the values configured by the user.
pluginName - the name of the plug-in
request - Stapler request
response - Stapler response
Throws:
IOException - if the values could not be persisted

getDynamic

public Object getDynamic(String graphId,
                         org.kohsuke.stapler.StaplerRequest request,
                         org.kohsuke.stapler.StaplerResponse response)
This method will be called by Stapler if an example image for the specified graph should be rendered.

Parameters:
graphId - the ID of the graph to render
request - Stapler request
response - Stapler response
Returns:
null

getGraphRenderer

public hudson.util.Graph getGraphRenderer(BuildResultGraph graph,
                                          String url)
Returns the graph renderer of the specified graph.

Parameters:
graph - the graph
url - the URL of links in the trend graph
Returns:
the graph renderer of the specified graph

getGraphRenderer

public hudson.util.Graph getGraphRenderer()
Returns the graph renderer of the current graph.

Returns:
the graph renderer of the current graph

getGraphRenderer

public hudson.util.Graph getGraphRenderer(String url)
Returns the graph renderer of the current graph.

Parameters:
url - the URL of links in the trend graph
Returns:
the graph renderer of the current graph

isHealthGraphAvailable

public boolean isHealthGraphAvailable()
Checks if the health graph is available.

Returns:
true, if the health graph is available

getHeight

public int getHeight()
Returns the height.

Returns:
the height

getWidth

public int getWidth()
Returns the width.

Returns:
the width

getUseBuildDateAsDomain

public boolean getUseBuildDateAsDomain()
Returns whether the build date or the build number should be used as domain.

Returns:
the build date or the build number should be used as domain

getTimestamp

public long getTimestamp()
Returns the time stamp of the associated build.

Returns:
the time stamp of the associated build.

getBuildCount

public int getBuildCount()
Returns the number of builds to consider.

Returns:
the number of builds to consider

getBuildCountString

public String getBuildCountString()
Returns the number of builds to consider.

Returns:
the number of builds to consider

getDayCount

public int getDayCount()
Returns the number of days to consider.

Returns:
the number of days to consider

getDayCountString

public String getDayCountString()
Returns the number of days to consider.

Returns:
the number of days to consider

getGraphType

public BuildResultGraph getGraphType()
Returns the type of the graph.

Returns:
the type

isVisible

public boolean isVisible()
Returns whether the trend graph is visible or not.

Returns:
true, if the trend graph is visible, false otherwise

isDeactivated

public boolean isDeactivated()
Returns whether the trend graph completely is deactivated.

Returns:
true, if the trend graph is deactivated, false otherwise

toString

public String toString()
Overrides:
toString in class Object

getHealthDescriptor

public AbstractHealthDescriptor getHealthDescriptor()
Returns the current health descriptor.

Returns:
the health descriptor


Copyright © 2004-2012 Hudson. All Rights Reserved.