org.apache.excalibur.instrument.client.http
Class AbstractHTTPInstrumentSampleElementData

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.excalibur.instrument.client.http.AbstractHTTPData
          extended by org.apache.excalibur.instrument.client.http.AbstractHTTPElementData
              extended by org.apache.excalibur.instrument.client.http.AbstractHTTPInstrumentSampleElementData
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, Data, ElementData, InstrumentSampleElementData
Direct Known Subclasses:
HTTPInstrumentSampleData, HTTPInstrumentSampleSnapshotData

abstract class AbstractHTTPInstrumentSampleElementData
extends AbstractHTTPElementData
implements InstrumentSampleElementData


Field Summary
private  long m_interval
          The sample interval.
private  long m_leaseExpirationTime
          The UNIX time when the lease expires.
private  int m_size
          The size of the sample history.
private  long m_time
          The UNIX time of the beginning of the sample.
private  int m_type
          The type of the Instrument Sample.
private  int m_value
          The sample value.
 
Fields inherited from interface org.apache.excalibur.instrument.client.InstrumentSampleElementData
INSTRUMENT_SAMPLE_TYPE_COUNTER, INSTRUMENT_SAMPLE_TYPE_MAXIMUM, INSTRUMENT_SAMPLE_TYPE_MEAN, INSTRUMENT_SAMPLE_TYPE_MINIMUM
 
Constructor Summary
AbstractHTTPInstrumentSampleElementData(HTTPInstrumentManagerConnection connection, AbstractHTTPData parent, java.lang.String name)
          Creates a new AbstractHTTPInstrumentSampleElementData.
 
Method Summary
 int getInstrumentType()
          Returns the Type of the Instrument which can use the sample.
 long getInterval()
          Returns the sample interval.
 long getLeaseExpirationTime()
          Obtain the UNIX time when the lease expires.
 int getSize()
          Returns the number of samples in the sample history.
 long getTime()
          Obtain the UNIX time of the beginning of the sample.
 int getType()
          Returns the type of the Instrument Sample.
 int getValue()
          Obtain the value of the sample.
protected  void update(org.apache.avalon.framework.configuration.Configuration configuration)
          Update the contents of the object using values from the Configuration object.
 
Methods inherited from class org.apache.excalibur.instrument.client.http.AbstractHTTPElementData
getName, getParent, isConfigured, lastNameToken
 
Methods inherited from class org.apache.excalibur.instrument.client.http.AbstractHTTPData
getConnection, getDescription, getStateVersion, urlEncode
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.excalibur.instrument.client.ElementData
getName, getParent, isConfigured
 
Methods inherited from interface org.apache.excalibur.instrument.client.Data
getDescription, getStateVersion, update
 

Field Detail

m_interval

private long m_interval
The sample interval.


m_size

private int m_size
The size of the sample history.


m_type

private int m_type
The type of the Instrument Sample.


m_value

private int m_value
The sample value.


m_time

private long m_time
The UNIX time of the beginning of the sample.


m_leaseExpirationTime

private long m_leaseExpirationTime
The UNIX time when the lease expires.

Constructor Detail

AbstractHTTPInstrumentSampleElementData

AbstractHTTPInstrumentSampleElementData(HTTPInstrumentManagerConnection connection,
                                        AbstractHTTPData parent,
                                        java.lang.String name)
Creates a new AbstractHTTPInstrumentSampleElementData.

Parameters:
connection - The connection used to communicate with the server.
parent - The parent data element.
name - The name of the data element.
Method Detail

update

protected void update(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Update the contents of the object using values from the Configuration object.

Overrides:
update in class AbstractHTTPElementData
Parameters:
configuration - Configuration object to load from.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - If there are any problems.

getInterval

public long getInterval()
Returns the sample interval. The period of each sample in millisends.

Specified by:
getInterval in interface InstrumentSampleElementData
Returns:
The sample interval.

getSize

public int getSize()
Returns the number of samples in the sample history.

Specified by:
getSize in interface InstrumentSampleElementData
Returns:
The size of the sample history.

getType

public int getType()
Returns the type of the Instrument Sample. Possible values include InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_COUNTER, InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MAXIMUM, InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MEAN, or InstrumentSampleData.INSTRUMENT_SAMPLE_TYPE_MINIMUM.

Specified by:
getType in interface InstrumentSampleElementData
Returns:
The type of the Instrument Sample.

getValue

public int getValue()
Obtain the value of the sample. All samples are integers, so the profiled objects must measure quantity (numbers of items), rate (items/period), time in milliseconds, etc.

Specified by:
getValue in interface InstrumentSampleElementData
Returns:
The sample value.

getTime

public long getTime()
Obtain the UNIX time of the beginning of the sample.

Specified by:
getTime in interface InstrumentSampleElementData
Returns:
The UNIX time of the beginning of the sample.

getLeaseExpirationTime

public long getLeaseExpirationTime()
Obtain the UNIX time when the lease expires.

Specified by:
getLeaseExpirationTime in interface InstrumentSampleElementData
Returns:
The UNIX time when the lease expires.

getInstrumentType

public int getInstrumentType()
Returns the Type of the Instrument which can use the sample. This should be the same for all instances of a class.

Should be one of the following: InstrumentData.PROFILE_POINT_TYPE_COUNTER or InstrumentData.PROFILE_POINT_TYPE_VALUE

Specified by:
getInstrumentType in interface InstrumentSampleElementData
Returns:
The Type of the Instrument which can use the sample.