Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.2)

E13403-10


oracle.jdeveloper.audit.analyzer
Class Metric

java.lang.Object
  extended by oracle.jdeveloper.audit.extension.ExtensionBean
      extended by oracle.jdeveloper.audit.analyzer.Metric

Direct Known Subclasses:
Attribute, CountColumn, SeverityColumn

public class Metric
extends ExtensionBean

A metric of constructs of the Audit object model. A metric can be thought of as supplying data for one column of a table (or tree table) in which the rows are constructs from the Audit object model. Rows can also be violations, for which a metric can also (less commonly) supply data.

The configurable state of a metric is exposed through JavaBeans properties. Every metric has five default properties: id, type, enabled, category, and threshold. category, id, and enabled are inherited from ExtensionBean); category, id, and type are read-only. The name is used internally, primarily as a resource key. The type indicates the most-specific type common to the values of the attribute. The category is used to group attributes for presentation purposes. The threshold, if any, indicates the largest acceptable value of the attribute. An attribute can expose additional properties which the Audit framework will discover by introspection and add to the appropriate Audit preferences panel. Attributes are registered with the AuditManager at startup by IDE extensions.

For typical metrics, the values for all constructs are computed and and stored in an AuditModel during the traversal of the construct hierarchy. It is possible, however, to create a metric that computes the values for some or all constructs from values available from the AuditModel that contains it, or from external sources (e.g., a database or data file). To enable this, Audit will automatically add a metric which implements AuditModelListener as a listener to the AuditModel for which it is a column.


Field Summary
protected  java.util.Comparator<java.lang.Object> comparator
           
protected  java.lang.Object threshold
           
protected  java.lang.Class<?> type
           

 

Fields inherited from class oracle.jdeveloper.audit.extension.ExtensionBean
DESCRIPTION_KEY, LABEL_KEY, SHORT_LABEL_KEY, TIP_KEY

 

Constructor Summary
Metric()
          Creates a metric.
Metric(java.lang.String name, Category category, java.lang.Class<?> valueType, Localizer localizer)
          Creates a metric with no thresholds.
Metric(java.lang.String name, Category category, java.lang.Class<?> valueType, java.lang.Object threshold, Localizer localizer)
          Creates a metric.
Metric(java.lang.String id, java.lang.String extensionId, Category category, java.lang.Class<?> valueType, java.lang.Object threshold)
          Creates a metric.

 

Method Summary
 java.util.Comparator<java.lang.Object> comparator()
          Gets a comparator for values of this attribute, or null if the values are not comparable.
protected  void copyInternalState(ExtensionBean copy, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context)
          Copies internal subclass state as part of creating a copy of this bean.
 Category getCategory()
          Gets the category of this metric.
 java.lang.Object getThreshold()
          Gets the upper threshold of this metric, or null if none.
 java.lang.Class<?> getType()
          Gets the type of this attribute.
 boolean isEnabled()
          Gets whether this rule is enabled.
 boolean isOutOfBand(java.lang.Object value)
          Gets whether a value is out of band.
 void setEnabled(boolean newValue)
          Sets whether this rule is enabled.
 void setThreshold(java.lang.Object newValue)
          Sets the upper threshold of this metric.
 java.lang.String toString()
           

 

Methods inherited from class oracle.jdeveloper.audit.extension.ExtensionBean
addPropertyChangeListener, addPropertyChangeListener, createCopy, description, equals, extensionId, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, formattedString, formattedString, hashCode, id, label, labelOrId, logError, logWarning, propertyDescription, propertyLabel, propertyString, propertyTip, removePropertyChangeListener, removePropertyChangeListener, setCompatibilityBundle, setStrings, setters, shortLabel, string, strings, tip

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

type

protected java.lang.Class<?> type

threshold

protected java.lang.Object threshold

comparator

protected java.util.Comparator<java.lang.Object> comparator

Constructor Detail

Metric

public Metric()
Creates a metric.

The Audit framework uses this constructor for metrics declared in an extension manifest, and then injects values for the ExtensionBean.id, ExtensionBean.extensionId, category, and type fields.


Metric

public Metric(java.lang.String id,
              java.lang.String extensionId,
              Category category,
              java.lang.Class<?> valueType,
              java.lang.Object threshold)
Creates a metric.

Th Audit framework uses this constructor used for metrics declared in an extension manifest.

Parameters:
id - The id of this metric.
category - The category of this metric.
valueType - The type of this metric.
threshold - The threshold of this metric.

Metric

public Metric(java.lang.String name,
              Category category,
              java.lang.Class<?> valueType,
              java.lang.Object threshold,
              Localizer localizer)
Creates a metric.
Parameters:
name - The non-localized name of this metric.
category - The category of this metric.
valueType - The type of this metric.
threshold - The threshold of this metric.
localizer - The localizer which supplies localized strings for this metric.

Metric

public Metric(java.lang.String name,
              Category category,
              java.lang.Class<?> valueType,
              Localizer localizer)
Creates a metric with no thresholds.
Parameters:
name - The name of this metric.
category - The category of this metric.
valueType - The type of this metric.
localizer - The localizer which supplies localized strings for this metric.

Method Detail

copyInternalState

protected void copyInternalState(ExtensionBean copy,
                                 java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context)
                          throws java.lang.reflect.InvocationTargetException
Description copied from class: ExtensionBean
Copies internal subclass state as part of creating a copy of this bean.
Overrides:
copyInternalState in class ExtensionBean
Parameters:
copy - The partially initialized copy.
context - A map which allows subclasses to preserve object identity when copying a graph of extension beans.
Throws:
java.lang.reflect.InvocationTargetException
See Also:
ExtensionBean.createCopy(java.util.IdentityHashMap<java.lang.Object, java.lang.Object>)

isEnabled

public boolean isEnabled()
Gets whether this rule is enabled.

setEnabled

public void setEnabled(boolean newValue)
Sets whether this rule is enabled.

getCategory

public Category getCategory()
Gets the category of this metric.

getType

public java.lang.Class<?> getType()
Gets the type of this attribute.

comparator

public java.util.Comparator<java.lang.Object> comparator()
Gets a comparator for values of this attribute, or null if the values are not comparable. The Metric implementation returns a default comparator if the attribute type is naturally ordered (i.e., implements Comparable) and returns null otherwise.

getThreshold

public java.lang.Object getThreshold()
Gets the upper threshold of this metric, or null if none.

setThreshold

public void setThreshold(java.lang.Object newValue)
Sets the upper threshold of this metric.
Parameters:
newValue - The value at which a measurement is considered out-of-band, or null if none.

isOutOfBand

public boolean isOutOfBand(java.lang.Object value)
Gets whether a value is out of band.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.2)

E13403-10


Copyright © 1997, 2013, Oracle. All rights reserved.