Sonic Management API

com.sonicsw.mf.common.metrics
Class MetricsFactory

java.lang.Object
  extended by com.sonicsw.mf.common.metrics.MetricsFactory

public final class MetricsFactory
extends java.lang.Object

Component developers are required to use the factory to create instances of implementations of the core metrics interfaces (of this pakage). The exception to this rule is that component developers can create their own IMetricsManager implementation - however the preferred model is to use the default manager provided by this factory.


Constructor Summary
MetricsFactory()
           
 
Method Summary
static IAlert createAlert(IMetricIdentity metricId, boolean isHighThreshold, long threshold)
          Creates an Alert object
static IAlert[] createAlerts(IMetricIdentity metricId, boolean isHighThreshold, java.lang.String thresholds)
          Creates an array of Alert objects from a comma delimited threshold string
static IMetric createMetric(IMetricIdentity id, long value, long currencyTimestamp)
          Returns a metric that encapsulates the metric identity and its value.
static IAggregateMetric createMetric(java.lang.String[] sources, IMetricIdentity id, long[] values, long currencyTimestamp)
          Returns an aggregate metric that encapsulates the metric identity, its aggregate values and the sources that contributed to the aggregated value of the metric.
static IHistoricalMetric createMetric(java.lang.String source, IMetric metric)
          Returns a historical metric that encapsulates the metric identity, its value and the source of the metric.
static IMetricIdentity createMetricIdentity(IMetricIdentity parentID, java.lang.String nameComponent)
          Returns a metric identity.
static IMetricIdentity createMetricIdentity(java.lang.String absoluteName)
          Returns a metric identity.
static IMetricIdentity createMetricIdentity(java.lang.String[] nameComponents)
          Returns a metric identity.
static IMetricInfo createMetricInfo(IMetricIdentity id, short valueType, java.lang.String description, java.lang.String extendedDataData, boolean isInstanceMetric, boolean isDynamic)
          Returns a info object that encapsulates the meta-data pertaining to an individual metric or instance metric.
static IMetricInfo createMetricInfo(IMetricIdentity id, short valueType, java.lang.String description, java.lang.String extendedDataData, boolean isInstanceMetric, boolean isDynamic, boolean supportsHighAlerts, boolean supportsLowAlerts, java.lang.String units)
          Returns a info object that encapsulates the meta-data pertaining to an individual metric or instance metric.
static IAggregateMetricsData createMetricsData(IAggregateMetric[] metrics, long currencyTimestamp)
          Returns an aggregate metrics data object that encapsulates the given aggregrate metrics.
static IMetricsData createMetricsData(IMetric[] metrics, long currencyTimestamp)
          Returns a metrics data object that encapsulates the given metrics.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricsFactory

public MetricsFactory()
Method Detail

createAlert

public static IAlert createAlert(IMetricIdentity metricId,
                                 boolean isHighThreshold,
                                 long threshold)
Creates an Alert object

Parameters:
IMetricIdentity - id The metric id this alert is associated with
isHighThreshold - Whether this is a high or low threshold
threshold - The threshold to set the alert to

createAlerts

public static IAlert[] createAlerts(IMetricIdentity metricId,
                                    boolean isHighThreshold,
                                    java.lang.String thresholds)
Creates an array of Alert objects from a comma delimited threshold string

Parameters:
IMetricIdentity - id The metric id these alert are associated with
isHighThreshold - Whether these are high or low thresholds
threshold - A comma delimited list of threshold values

createMetric

public static IMetric createMetric(IMetricIdentity id,
                                   long value,
                                   long currencyTimestamp)
Returns a metric that encapsulates the metric identity and its value.


createMetric

public static IAggregateMetric createMetric(java.lang.String[] sources,
                                            IMetricIdentity id,
                                            long[] values,
                                            long currencyTimestamp)
Returns an aggregate metric that encapsulates the metric identity, its aggregate values and the sources that contributed to the aggregated value of the metric. For use by the framework and not application components.


createMetric

public static IHistoricalMetric createMetric(java.lang.String source,
                                             IMetric metric)
Returns a historical metric that encapsulates the metric identity, its value and the source of the metric. For use by the framework and not application components.


createMetricIdentity

public static IMetricIdentity createMetricIdentity(IMetricIdentity parentID,
                                                   java.lang.String nameComponent)
Returns a metric identity. The values supplied should be valid for the life cycle of the component.

Parameters:
parentID - The metric identity of the parent.
nameComponent - The name component of the child of the parent. Special characters '.' and '\' are treated as part of the name component rather than as further delimiting.

createMetricIdentity

public static IMetricIdentity createMetricIdentity(java.lang.String absoluteName)
Returns a metric identity. The values supplied should be valid for the life cycle of the component.

Parameters:
absoluteName - An a period '.' delimited string that describe the path of the metric in in the components tree of metrics (each token representing a component of the metric name). If a component of a metric name contains periods '.' or percents '%' then those should be escaped by a percent e.g. "%."

createMetricIdentity

public static IMetricIdentity createMetricIdentity(java.lang.String[] nameComponents)
Returns a metric identity. The values supplied should be valid for the life cycle of the component.

Parameters:
nameCompnents - An array of strings that describe the path of the metric in in the components tree of metrics.

createMetricInfo

public static IMetricInfo createMetricInfo(IMetricIdentity id,
                                           short valueType,
                                           java.lang.String description,
                                           java.lang.String extendedDataData,
                                           boolean isInstanceMetric,
                                           boolean isDynamic)
Returns a info object that encapsulates the meta-data pertaining to an individual metric or instance metric. Does not specify alerts.

See Also:
createMetricInfo(IMetricIdentity, short, String, String, boolean, boolean, boolean, boolean, String)

createMetricInfo

public static IMetricInfo createMetricInfo(IMetricIdentity id,
                                           short valueType,
                                           java.lang.String description,
                                           java.lang.String extendedDataData,
                                           boolean isInstanceMetric,
                                           boolean isDynamic,
                                           boolean supportsHighAlerts,
                                           boolean supportsLowAlerts,
                                           java.lang.String units)
Returns a info object that encapsulates the meta-data pertaining to an individual metric or instance metric.

Parameters:
id - The metric identity.
valueType - The metric value type (see IValueType defined types).
description - The optional free form description of the metric.
extendedDataData - The optional free form data associated with the metric.
isInstanceMetric - Indicates the meta-data describes metrics that are parented by the instance metric.
isDynamic - Indicates the metric can be enabled/disabled at runtime.
supportsHighAlerts - Indicates the metric supports high threshold alerts.
supportsLowAlerts - Indicates the metric supports low threshold alerts.
units - The units that this metric uses.
See Also:
createMetricInfo(IMetricIdentity, short, String, String, boolean, boolean), IValueType

createMetricsData

public static IAggregateMetricsData createMetricsData(IAggregateMetric[] metrics,
                                                      long currencyTimestamp)
Returns an aggregate metrics data object that encapsulates the given aggregrate metrics. The currency timestamp of the metrics data object will be set to the provided value.


createMetricsData

public static IMetricsData createMetricsData(IMetric[] metrics,
                                             long currencyTimestamp)
Returns a metrics data object that encapsulates the given metrics. The currency timestamp of the metrics data object will be set to the provided value.


Sonic Management API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.