Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.ui.util
Class MonitorUtils

java.lang.Object
  extended by org.hyperic.hq.ui.util.MonitorUtils

public class MonitorUtils
extends java.lang.Object


Field Summary
static java.lang.String BEGIN
           
static int DEFAULT_CURRENTHEALTH_LASTN
           
static java.lang.Integer DEFAULT_VALUE_RANGE_LASTN
           
static java.lang.Boolean DEFAULT_VALUE_RANGE_RO
           
static java.lang.Integer DEFAULT_VALUE_RANGE_UNIT
           
static java.lang.String END
           
static java.lang.String LASTN
           
static java.lang.String RO
           
static java.lang.String THRESHOLD_BASELINE_LABEL
           
static int THRESHOLD_BASELINE_VALUE
           
static java.lang.String THRESHOLD_HIGH_RANGE_LABEL
           
static int THRESHOLD_HIGH_RANGE_VALUE
           
static java.lang.String THRESHOLD_LOW_RANGE_LABEL
           
static int THRESHOLD_LOW_RANGE_VALUE
           
static int THRESHOLD_OVER_VALUE
           
static int THRESHOLD_UNDER_VALUE
           
static java.lang.String UNIT
           
static int UNIT_COLLECTION_POINTS
           
static int UNIT_DAYS
           
static int UNIT_HOURS
           
static int UNIT_MINUTES
           
 
Constructor Summary
MonitorUtils()
           
 
Method Summary
static java.util.List calculateTimeFrame(int lastN, int unit)
          Method calculateTimeFrame Returns a two elementList of Long objects representing the begin and end times (in milliseconds since the epoch) of the timeframe.
static java.lang.Integer findDefaultChildResourceId(java.util.List resourceTypes, java.util.Map resourceCounts)
          Method findDefaultChildResourceId Return the id of the first child resource type (according to whatever order in which the BizApp lists them) for which the parent resource has one or more defined child resources.
static java.util.List findServerTypes(java.util.List servers)
           
static java.util.List findServiceTypes(java.util.List services, java.lang.Boolean internal)
          Method findServiceTypes.
static java.lang.Integer formatMetrics(java.util.Map metrics, java.util.Locale userLocale, org.apache.struts.util.MessageResources msgs)
           
static java.util.List getSubMiniTabs(java.util.List resourceTypes, java.util.Map resourceCounts, java.lang.Integer selectedId)
          Method getSubMiniTabs Returns a list of SubMiniTab objects to be displayed below the Monitor mini tabs.
static java.util.List getThresholdMenu()
           
static void traceMetricDisplaySummaryMap(org.apache.commons.logging.Log logger, java.util.Map metrics)
          Sometimes, it's useful to just get a dump of all of the metrics returned by the backend.
static void traceResourceTypeDisplaySummaryList(org.apache.commons.logging.Log logger, java.util.List healths)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RO

public static final java.lang.String RO
See Also:
Constant Field Values

LASTN

public static final java.lang.String LASTN
See Also:
Constant Field Values

UNIT

public static final java.lang.String UNIT
See Also:
Constant Field Values

BEGIN

public static final java.lang.String BEGIN
See Also:
Constant Field Values

END

public static final java.lang.String END
See Also:
Constant Field Values

DEFAULT_CURRENTHEALTH_LASTN

public static final int DEFAULT_CURRENTHEALTH_LASTN
See Also:
Constant Field Values

DEFAULT_VALUE_RANGE_RO

public static final java.lang.Boolean DEFAULT_VALUE_RANGE_RO

DEFAULT_VALUE_RANGE_LASTN

public static final java.lang.Integer DEFAULT_VALUE_RANGE_LASTN

DEFAULT_VALUE_RANGE_UNIT

public static final java.lang.Integer DEFAULT_VALUE_RANGE_UNIT

UNIT_COLLECTION_POINTS

public static final int UNIT_COLLECTION_POINTS
See Also:
Constant Field Values

UNIT_MINUTES

public static final int UNIT_MINUTES
See Also:
Constant Field Values

UNIT_HOURS

public static final int UNIT_HOURS
See Also:
Constant Field Values

UNIT_DAYS

public static final int UNIT_DAYS
See Also:
Constant Field Values

THRESHOLD_BASELINE_VALUE

public static final int THRESHOLD_BASELINE_VALUE
See Also:
Constant Field Values

THRESHOLD_BASELINE_LABEL

public static final java.lang.String THRESHOLD_BASELINE_LABEL
See Also:
Constant Field Values

THRESHOLD_HIGH_RANGE_VALUE

public static final int THRESHOLD_HIGH_RANGE_VALUE
See Also:
Constant Field Values

THRESHOLD_HIGH_RANGE_LABEL

public static final java.lang.String THRESHOLD_HIGH_RANGE_LABEL
See Also:
Constant Field Values

THRESHOLD_LOW_RANGE_VALUE

public static final int THRESHOLD_LOW_RANGE_VALUE
See Also:
Constant Field Values

THRESHOLD_LOW_RANGE_LABEL

public static final java.lang.String THRESHOLD_LOW_RANGE_LABEL
See Also:
Constant Field Values

THRESHOLD_UNDER_VALUE

public static final int THRESHOLD_UNDER_VALUE
See Also:
Constant Field Values

THRESHOLD_OVER_VALUE

public static final int THRESHOLD_OVER_VALUE
See Also:
Constant Field Values
Constructor Detail

MonitorUtils

public MonitorUtils()
Method Detail

calculateTimeFrame

public static java.util.List calculateTimeFrame(int lastN,
                                                int unit)
Method calculateTimeFrame Returns a two elementList of Long objects representing the begin and end times (in milliseconds since the epoch) of the timeframe. Returns null instead if the time unit is indicated as UNIT_COLLECTION_POINTS.

Parameters:
lastN - the number of time units in the time frame
unit - the unit of time (as defined by UNIT_* constants
Returns:
List

getSubMiniTabs

public static java.util.List getSubMiniTabs(java.util.List resourceTypes,
                                            java.util.Map resourceCounts,
                                            java.lang.Integer selectedId)
Method getSubMiniTabs Returns a list of SubMiniTab objects to be displayed below the Monitor mini tabs. The properties of each SubMiniTab will be set by examining the corresponding AppdefResourceTypeValue:

Parameters:
resourceTypes - a List of AppdefResourceTypeValue objects
resourceCounts - a Map of resource counts keyed by resource type name
selectedId - a Integer identifying the particular resource type that is being currently viewed 8 @return List

findDefaultChildResourceId

public static java.lang.Integer findDefaultChildResourceId(java.util.List resourceTypes,
                                                           java.util.Map resourceCounts)
Method findDefaultChildResourceId Return the id of the first child resource type (according to whatever order in which the BizApp lists them) for which the parent resource has one or more defined child resources.

Parameters:
resourceTypes - a List of AppdefResourceTypeValue objects
resourceCounts - a Map of resource counts keyed by resource type name
Returns:
Integer

findServiceTypes

public static java.util.List findServiceTypes(java.util.List services,
                                              java.lang.Boolean internal)
Method findServiceTypes. Given a List of services associated with an application or server, filter through them for the service types so we can link to showing selections by type. The returned List has the ServiceTypeValue as elements. This should eventually get pushed into the bizapp

Parameters:
services -
Returns:
List

findServerTypes

public static java.util.List findServerTypes(java.util.List servers)

traceMetricDisplaySummaryMap

public static void traceMetricDisplaySummaryMap(org.apache.commons.logging.Log logger,
                                                java.util.Map metrics)
Sometimes, it's useful to just get a dump of all of the metrics returned by the backend.

Parameters:
log -
metrics - a Map keyed on the category (String), values are List's of MetricDisplaySummary beans

traceResourceTypeDisplaySummaryList

public static void traceResourceTypeDisplaySummaryList(org.apache.commons.logging.Log logger,
                                                       java.util.List healths)

formatMetrics

public static java.lang.Integer formatMetrics(java.util.Map metrics,
                                              java.util.Locale userLocale,
                                              org.apache.struts.util.MessageResources msgs)

getThresholdMenu

public static java.util.List getThresholdMenu()

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.