com.sonyericsson.jenkins.plugins.bfa
Class BfaGraphAction

java.lang.Object
  extended by com.sonyericsson.jenkins.plugins.bfa.BfaGraphAction
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.ModelObject, hudson.model.RootAction
Direct Known Subclasses:
CauseManagement, ComputerGraphAction, ProjectGraphAction

public abstract class BfaGraphAction
extends Object
implements hudson.model.RootAction

Abstract class to handle the detailed graphs pages.

Author:
Christoffer Lauri <christoffer.lauri@sonymobile.com>

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
protected static int DEFAULT_GRAPH_HEIGHT
          Default height for graphs on detail pages.
protected static int DEFAULT_GRAPH_WIDTH
          Default width for graphs on detail pages.
protected static String EXCLUDE_ABORTED
          Constant for "ABORTED"-cause (used to exclude such FailureCauses).
protected static char ID_SEPARATOR
          Separator between different parts of graph IDs.
protected static String URL_PARAM_ALL_MASTERS
          Url-parameter for indicating whether to show for all masters or not.
protected static String URL_PARAM_SHOW_ABORTED
          Url-parameter for indicating whether to show or hide aborted builds.
protected static String URL_PARAM_TIME_PERIOD
          Url-parameter for indicating time period to show in a graph.
protected static String URL_PARAM_VALUE_MAX
          Url-parameter value for 'max'.
protected static String URL_PARAM_VALUE_MONTH
          Url-parameter value for 'month'.
protected static String URL_PARAM_VALUE_TODAY
          Url-parameter value for 'today'.
protected static String URL_PARAM_WHICH_GRAPH
          Url-parameter for indicating which graph to show.
 
Constructor Summary
BfaGraphAction()
           
 
Method Summary
 int getDefaultGraphHeight()
          Helper for groovy-views; Get the default height of graphs on detailed pages.
 int getDefaultGraphWidth()
          Helper for groovy-views; Get the default width of graphs on detailed pages.
protected abstract  hudson.util.Graph getGraph(GraphType which, Date timePeriod, boolean hideManAborted, boolean allMasters, Map<String,String> rawReqParams)
          Get the graph corresponding to the specified arguments.
 hudson.util.Graph getGraph(org.kohsuke.stapler.StaplerRequest req)
          Get the Graph corresponding to the url-parameters.
protected abstract  String getGraphCacheId(GraphType whichGraph, String reqTimePeriod, boolean hideAborted, boolean forAllMasters)
          Get a unique id used in the caching of the graph.
abstract  String getGraphsPageTitle()
          Get the title to display in the top of the detailed graphs page.
abstract  GraphType[] getGraphTypes()
          Returns an array of GraphTypes, where each element represents a graph.
abstract  hudson.model.ModelObject getOwner()
          Get the owner.
 boolean showGraphDelayText()
          Helper for the groovy-views; show/hide info text for graph delay.
 boolean showMasterSwitch()
          Helper for the groovy-views; show/hide Masters-switch.
 
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, getIconFileName, getUrlName
 

Field Detail

URL_PARAM_TIME_PERIOD

protected static final String URL_PARAM_TIME_PERIOD
Url-parameter for indicating time period to show in a graph.

See Also:
Constant Field Values

URL_PARAM_WHICH_GRAPH

protected static final String URL_PARAM_WHICH_GRAPH
Url-parameter for indicating which graph to show.

See Also:
Constant Field Values

URL_PARAM_SHOW_ABORTED

protected static final String URL_PARAM_SHOW_ABORTED
Url-parameter for indicating whether to show or hide aborted builds.

See Also:
Constant Field Values

URL_PARAM_ALL_MASTERS

protected static final String URL_PARAM_ALL_MASTERS
Url-parameter for indicating whether to show for all masters or not.

See Also:
Constant Field Values

URL_PARAM_VALUE_TODAY

protected static final String URL_PARAM_VALUE_TODAY
Url-parameter value for 'today'.

See Also:
Constant Field Values

URL_PARAM_VALUE_MONTH

protected static final String URL_PARAM_VALUE_MONTH
Url-parameter value for 'month'.

See Also:
Constant Field Values

URL_PARAM_VALUE_MAX

protected static final String URL_PARAM_VALUE_MAX
Url-parameter value for 'max'.

See Also:
Constant Field Values

DEFAULT_GRAPH_WIDTH

protected static final int DEFAULT_GRAPH_WIDTH
Default width for graphs on detail pages.

See Also:
Constant Field Values

DEFAULT_GRAPH_HEIGHT

protected static final int DEFAULT_GRAPH_HEIGHT
Default height for graphs on detail pages.

See Also:
Constant Field Values

EXCLUDE_ABORTED

protected static final String EXCLUDE_ABORTED
Constant for "ABORTED"-cause (used to exclude such FailureCauses).

See Also:
Constant Field Values

ID_SEPARATOR

protected static final char ID_SEPARATOR
Separator between different parts of graph IDs.

See Also:
Constant Field Values
Constructor Detail

BfaGraphAction

public BfaGraphAction()
Method Detail

getOwner

public abstract hudson.model.ModelObject getOwner()
Get the owner.

Returns:
The owner

getGraphTypes

public abstract GraphType[] getGraphTypes()
Returns an array of GraphTypes, where each element represents a graph. These are the types used to display the graphs/images on the detailed graphs page, that is, they will be the 'which'-parameter to getGraph(GraphType which, Date ...). The graphs are displayed in the same order as the numbers in the array.

Returns:
An array of GraphTypes where each element represents a graph to display

getGraphsPageTitle

public abstract String getGraphsPageTitle()
Get the title to display in the top of the detailed graphs page.

Returns:
The title as a String

getGraph

protected abstract hudson.util.Graph getGraph(GraphType which,
                                              Date timePeriod,
                                              boolean hideManAborted,
                                              boolean allMasters,
                                              Map<String,String> rawReqParams)
Get the graph corresponding to the specified arguments.

Parameters:
which - Which graph to display
timePeriod - How old statistics should be included in the graph
hideManAborted - Hide manually aborted causes
allMasters - Show for all masters
rawReqParams - The url parameters that came with the request
Returns:
A Graph

getGraph

public hudson.util.Graph getGraph(org.kohsuke.stapler.StaplerRequest req)
Get the Graph corresponding to the url-parameters. Parameters: - time : how far back should statistics be included - which : which graph to display - showAborted : show manually aborted - allMasters : show for all masters

Parameters:
req - The StaplerRequest
Returns:
A graph

getGraphCacheId

protected abstract String getGraphCacheId(GraphType whichGraph,
                                          String reqTimePeriod,
                                          boolean hideAborted,
                                          boolean forAllMasters)
Get a unique id used in the caching of the graph.

Parameters:
whichGraph - Which graph
reqTimePeriod - The selected time period
hideAborted - Hide aborted builds
forAllMasters - For all masters
Returns:
An id corresponding to the specified arguments

getDefaultGraphWidth

public int getDefaultGraphWidth()
Helper for groovy-views; Get the default width of graphs on detailed pages.

Returns:
The default height of graphs on the detailed graphs-page

getDefaultGraphHeight

public int getDefaultGraphHeight()
Helper for groovy-views; Get the default height of graphs on detailed pages.

Returns:
The default height of graphs on the detailed graphs-page

showMasterSwitch

public boolean showMasterSwitch()
Helper for the groovy-views; show/hide Masters-switch. Whether to show links for switching between all masters and the own master.

Returns:
True to show the switch, otherwise false

showGraphDelayText

public boolean showGraphDelayText()
Helper for the groovy-views; show/hide info text for graph delay. The info text will inform the user about the delay for graphs because of caching.

Returns:
True to show the text, otherwise false


Copyright © 2004-2014. All Rights Reserved.