com.h3c.sdn.metric

## Class MetricDescriptor

- java.lang.Object
- - com.h3c.sdn.metric.MetricDescriptor

- All Implemented Interfaces:
    Comparable<MetricDescriptor>
  Direct Known Subclasses:
    CounterDescriptor, GaugeDescriptor, HistogramDescriptor, MeterDescriptor, RatioGaugeDescriptor, RollingCounterDescriptor, TimerDescriptor

      public abstract class MetricDescriptor
      extends Object
      implements Comparable<MetricDescriptor>

  Metric descriptor object, which specifies numerous properties that shape the processing and handling of a `TimeStampedMetric` object.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MetricDescriptor.MetricDescriptorBuilder<T extends MetricDescriptor>` Metric descriptor builder object, which requires that only arguments that are mandatory for the construction of a `MetricDescriptor` be specified during its own construction.
    `static class` | `MetricDescriptor.SummaryIntervalMinutes` The set of permitted values for the interval that can elapse between summarizations of a `TimeStampedMetric` value.
    `static class` | `MetricDescriptor.Type` The set of permitted values for `TimeStampedMetric` types.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_TAG` The default tag used internally

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MetricDescriptor(MetricDescriptor.Type type, String appId, String name, String primaryTag, String secondaryTag, String description, boolean persist, MetricDescriptor.SummaryIntervalMinutes minutes, boolean jmx)` Creates a new `MetricDescriptor` that can subsequently be used when creating a new `TimeStampedMetric`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(MetricDescriptor toCompare)`
    `boolean` | `equals(Object toCompare)`
    `String` | `getAppId()` Gets the application ID associated with the `TimeStampedMetric`, presumably the ID of the application that requested the `TimeStampedMetric`'s creation.
    `String` | `getDescription()` Gets the description of the `TimeStampedMetric`.
    `String` | `getName()` Gets the name of the `TimeStampedMetric`.
    `boolean` | `getPersist()` Gets the flag that indicates whether the `TimeStampedMetric` value is to be persisted.
    `String` | `getPrimaryTag()` Gets the primary tag for the `TimeStampedMetric`.
    `boolean` | `getPublishToJmx()` Gets the flag that indicates whether the `TimeStampedMetric` value should be made visible via JMX.
    `String` | `getSecondaryTag()` Gets the secondary tag for the `TimeStampedMetric`.
    `MetricDescriptor.SummaryIntervalMinutes` | `getSummaryMinutes()` Gets the number of minutes that should elapse between the persistence of summarized values for the `TimeStampedMetric`.
    `MetricDescriptor.Type` | `getType()` Gets the metric type for the `TimeStampedMetric`.
    `int` | `hashCode()`
    `void` | `setAppId(String toSet)` Sets the application ID associated with the `TimeStampedMetric`, presumably the ID of the application that requested the `TimeStampedMetric`'s creation.
    `void` | `setSummaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)` Sets the number of minutes that should elapse between the persistence of summarized values for the `TimeStampedMetric`.
    `String` | `toDebugString()` Gets a detailed representation of this object to facilitate debugging.
    `String` | `toString()`
    `String` | `uniqueName()` Produces a name built from the combination of fields, sans application ID, that uniquely distinguish the `TimeStampedMetric` described by this object from other `TimeStampedMetric`s.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_TAG

          public static final String DEFAULT_TAG

      The default tag used internally
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MetricDescriptor

          protected MetricDescriptor(MetricDescriptor.Type type,
                          String appId,
                          String name,
                          String primaryTag,
                          String secondaryTag,
                          String description,
                          boolean persist,
                          MetricDescriptor.SummaryIntervalMinutes minutes,
                          boolean jmx)

      Creates a new `MetricDescriptor` that can subsequently be used when creating a new `TimeStampedMetric`.
      Parameters:
        `type` - the metric type
        `appId` - an application ID that the `TimeStampedMetric` should be associated with
        `name` - a name for the `TimeStampedMetric` (e.g. "txPackets")
        `primaryTag` - the primary tag for the `TimeStampedMetric` (e.g. "router-1.2.3.4")
        `secondaryTag` - the secondary tag for the `TimeStampedMetric` (e.g. "port1")
        `description` - a description for the `TimeStampedMetric`
        `persist` - whether the `TimeStampedMetric` should be persisted
        `minutes` - the number of minutes that should elapse between summarizations of the `TimeStampedMetric` value
        `jmx` - whether the `TimeStampedMetric` value should be visible via JMX
      Throws:
        `IllegalArgumentException` - if a null value is supplied for either the type or name parameters

  - ### Method Detail

    - #### compareTo

          public int compareTo(MetricDescriptor toCompare)

      Specified by:
        `compareTo` in interface `Comparable<MetricDescriptor>`

    - #### equals

          public boolean equals(Object toCompare)

      Overrides:
        `equals` in class `Object`

    - #### getAppId

          public String getAppId()

      Gets the application ID associated with the `TimeStampedMetric`, presumably the ID of the application that requested the `TimeStampedMetric`'s creation.
      Returns:
        application ID

    - #### getDescription

          public String getDescription()

      Gets the description of the `TimeStampedMetric`.
      Returns:
        description

    - #### getName

          public String getName()

      Gets the name of the `TimeStampedMetric`.
      Returns:
        name

    - #### getPersist

          public boolean getPersist()

      Gets the flag that indicates whether the `TimeStampedMetric` value is to be persisted.
      Returns:
        persistence flag

    - #### getPrimaryTag

          public String getPrimaryTag()

      Gets the primary tag for the `TimeStampedMetric`.
      Returns:
        primary tag

    - #### getPublishToJmx

          public boolean getPublishToJmx()

      Gets the flag that indicates whether the `TimeStampedMetric` value should be made visible via JMX.
      Returns:
        JMX flag

    - #### getSecondaryTag

          public String getSecondaryTag()

      Gets the secondary tag for the `TimeStampedMetric`.
      Returns:
        secondary tag

    - #### getSummaryMinutes

          public MetricDescriptor.SummaryIntervalMinutes getSummaryMinutes()

      Gets the number of minutes that should elapse between the persistence of summarized values for the `TimeStampedMetric`.
      Returns:
        summarization interval (in minutes)

    - #### getType

          public MetricDescriptor.Type getType()

      Gets the metric type for the `TimeStampedMetric`.
      Returns:
        metric type

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### setAppId

          public void setAppId(String toSet)

      Sets the application ID associated with the `TimeStampedMetric`, presumably the ID of the application that requested the `TimeStampedMetric`'s creation. Any white space in the specified ID will be stripped.
      Parameters:
        `toSet` - application ID

    - #### setSummaryMinutes

          public void setSummaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)

      Sets the number of minutes that should elapse between the persistence of summarized values for the `TimeStampedMetric`.
      Parameters:
        `toSet` - summarization interval (in minutes)

    - #### toDebugString

          public String toDebugString()

      Gets a detailed representation of this object to facilitate debugging.
      Returns:
        debug representation of object

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### uniqueName

          public String uniqueName()

      Produces a name built from the combination of fields, sans application ID, that uniquely distinguish the `TimeStampedMetric` described by this object from other `TimeStampedMetric`s.
      Returns:
        unique name

Copyright © 2014. All Rights Reserved.