org.rhq.core.domain.measurement
Class MeasurementDefinition

java.lang.Object
  extended by org.rhq.core.domain.measurement.MeasurementDefinition
All Implemented Interfaces:
Serializable

public class MeasurementDefinition
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String DISABLE_ALL
           
static String FIND_BY_IDS
           
static String FIND_BY_RESOURCE_TYPE_DATA_TYPE_DISPLAY_TYPE
           
static String FIND_SCHEDULE_COMPOSITE_FOR_RESOURCE_TYPE
           
 
Constructor Summary
protected MeasurementDefinition()
           
  MeasurementDefinition(MeasurementDefinition def)
           
  MeasurementDefinition(ResourceType resourceType, String name)
           
  MeasurementDefinition(String name, MeasurementCategory category, MeasurementUnits units, DataType dataType, boolean defaultOn, long defaultInterval, DisplayType displayType)
          Creates a definition with the given data type.
  MeasurementDefinition(String name, MeasurementCategory category, MeasurementUnits units, DataType dataType, NumericType numericType, boolean defaultOn, long defaultInterval, DisplayType displayType)
           
  MeasurementDefinition(String name, MeasurementCategory category, MeasurementUnits units, NumericType numericType, boolean defaultOn, long defaultInterval, DisplayType displayType)
          Deprecated. 
 
Method Summary
 List<MeasurementSchedule> addSchedule(MeasurementSchedule ms)
          Helper to add a new Schedule to this definition.
 boolean equals(Object o)
           
 List<AlertCondition> getAlertCondition()
           
 MeasurementCategory getCategory()
           
 DataType getDataType()
           
 long getDefaultInterval()
           
 String getDescription()
           
 String getDestinationType()
           
 String getDisplayName()
           
 int getDisplayOrder()
          When displaying items on screen - in what order should that be?
 DisplayType getDisplayType()
           
 int getId()
           
 String getName()
           
 NumericType getNumericType()
           
 NumericType getRawNumericType()
           
 ResourceType getResourceType()
           
 List<MeasurementSchedule> getSchedules()
           
 MeasurementUnits getUnits()
           
 int hashCode()
           
 boolean isDefaultOn()
           
 boolean isPerMinute()
           
 void setAlertCondition(List<AlertCondition> alertConditions)
           
 void setCategory(MeasurementCategory category)
           
 void setDataType(DataType dataType)
           
 void setDefaultInterval(long defaultInterval)
           
 void setDefaultOn(boolean defaultOn)
           
 void setDescription(String description)
           
 void setDestinationType(String destinationType)
           
 void setDisplayName(String displayName)
           
 void setDisplayOrder(int i)
          When displaying items on screen - in what order should that be?
 void setDisplayType(DisplayType displayType)
           
 void setId(int id)
           
 void setMeasurementType(NumericType numericType)
           
 void setName(String name)
           
 void setNumericType(NumericType type)
           
 void setRawNumericType(NumericType rawNumericType)
           
 void setResourceType(ResourceType resourceType)
           
 void setSchedules(List<MeasurementSchedule> schedules)
           
 void setUnits(MeasurementUnits units)
           
 String toString()
           
 void update(MeasurementDefinition newDefinition, boolean alsoUpdateInterval)
          This method is intended to update an existing measurement definition object with the contents of another object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIND_BY_RESOURCE_TYPE_DATA_TYPE_DISPLAY_TYPE

public static final String FIND_BY_RESOURCE_TYPE_DATA_TYPE_DISPLAY_TYPE
See Also:
Constant Field Values

FIND_SCHEDULE_COMPOSITE_FOR_RESOURCE_TYPE

public static final String FIND_SCHEDULE_COMPOSITE_FOR_RESOURCE_TYPE
See Also:
Constant Field Values

FIND_BY_IDS

public static final String FIND_BY_IDS
See Also:
Constant Field Values

DISABLE_ALL

public static final String DISABLE_ALL
See Also:
Constant Field Values
Constructor Detail

MeasurementDefinition

protected MeasurementDefinition()

MeasurementDefinition

@Deprecated
public MeasurementDefinition(String name,
                                        MeasurementCategory category,
                                        MeasurementUnits units,
                                        NumericType numericType,
                                        boolean defaultOn,
                                        long defaultInterval,
                                        DisplayType displayType)
Deprecated. 

Creates a definition whose data type is DataType.MEASUREMENT. This does not take a resourceType because this is a dependent child type entity of ResourceType, and this object's ResourceType is set when adding it to the parent ResourceType.

Parameters:
name - The name of this definition. Must be unique
category - What kind of Metric is this (avail., throughput, ..)
units - The MetricUnit of this type of Metric
numericType - Is this dynamic or trendsup/down data
defaultOn - Shall Schedules created with this definition be enabled by default?
defaultInterval - The default interval in ms between two Measurements

MeasurementDefinition

public MeasurementDefinition(String name,
                             MeasurementCategory category,
                             MeasurementUnits units,
                             DataType dataType,
                             NumericType numericType,
                             boolean defaultOn,
                             long defaultInterval,
                             DisplayType displayType)

MeasurementDefinition

public MeasurementDefinition(String name,
                             MeasurementCategory category,
                             MeasurementUnits units,
                             DataType dataType,
                             boolean defaultOn,
                             long defaultInterval,
                             DisplayType displayType)
Creates a definition with the given data type. If the data type is DataType.MEASUREMENT, consider using the other constructor that takes the NumericType instead.

Parameters:
name - The name of this definition. Must be unique
category - What kind of Metric is this (avail., throughput, ..)
units - The MetricUnit of this type of Metric
dataType - what kind of data will this be (measurement? trait?)
defaultOn - Shall Schedules created with this definition be enabled by default?
defaultInterval - The default interval in ms between two Measurements
See Also:
MeasurementDefinition(String, MeasurementCategory, MeasurementUnits, NumericType, boolean, long, DisplayType)

MeasurementDefinition

public MeasurementDefinition(MeasurementDefinition def)

MeasurementDefinition

public MeasurementDefinition(ResourceType resourceType,
                             @NotNull
                             String name)
Method Detail

addSchedule

public List<MeasurementSchedule> addSchedule(MeasurementSchedule ms)
Helper to add a new Schedule to this definition.

Parameters:
ms - a Metric Schedule
Returns:
Complete List of all schedules including the new one

toString

public String toString()
Overrides:
toString in class Object

getResourceType

public ResourceType getResourceType()

setResourceType

public void setResourceType(ResourceType resourceType)

getCategory

public MeasurementCategory getCategory()

setCategory

public void setCategory(MeasurementCategory category)

getNumericType

public NumericType getNumericType()

setNumericType

public void setNumericType(NumericType type)

setMeasurementType

public void setMeasurementType(NumericType numericType)

getDataType

public DataType getDataType()

setDataType

public void setDataType(DataType dataType)

getDisplayType

public DisplayType getDisplayType()

setDisplayType

public void setDisplayType(DisplayType displayType)

getDefaultInterval

public long getDefaultInterval()

setDefaultInterval

public void setDefaultInterval(long defaultInterval)

isDefaultOn

public boolean isDefaultOn()

setDefaultOn

public void setDefaultOn(boolean defaultOn)

getName

@NotNull
public String getName()

setName

public void setName(@NotNull
                    String name)

getDisplayName

@NotNull
public String getDisplayName()

setDisplayName

public void setDisplayName(String displayName)

getSchedules

public List<MeasurementSchedule> getSchedules()

setSchedules

public void setSchedules(List<MeasurementSchedule> schedules)

getUnits

public MeasurementUnits getUnits()

setUnits

public void setUnits(MeasurementUnits units)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getId

public int getId()

setId

public void setId(int id)

isPerMinute

public boolean isPerMinute()

getRawNumericType

public NumericType getRawNumericType()

setRawNumericType

public void setRawNumericType(NumericType rawNumericType)

update

public void update(MeasurementDefinition newDefinition,
                   boolean alsoUpdateInterval)
This method is intended to update an existing measurement definition object with the contents of another object. It is intended for updates to existing connected objects from disconnected and separately loaded objects. The name, its referenced resource type and other referenced objects are not changed in this object as they can not be updated or are part of the identity of this object.

Parameters:
newDefinition - the definition holding the new contents
alsoUpdateInterval - should the default interval also be updated?

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getDisplayOrder

public int getDisplayOrder()
When displaying items on screen - in what order should that be? This is filled in from the metadata from the plugin descriptor. A value of -1 means "don't care".

Returns:
the displayOrder

setDisplayOrder

public void setDisplayOrder(int i)
When displaying items on screen - in what order should that be? This is filled in from the metadata from the plugin descriptor. A value of -1 means "don't care".

Parameters:
i - the displayOrder to set

getDestinationType

@Nullable
public String getDestinationType()

setDestinationType

public void setDestinationType(@Nullable
                               String destinationType)

getAlertCondition

public List<AlertCondition> getAlertCondition()

setAlertCondition

public void setAlertCondition(List<AlertCondition> alertConditions)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.