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

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.HTTPInstrumentData
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, Data, ElementData, InstrumentData

 class HTTPInstrumentData
extends AbstractHTTPElementData
implements InstrumentData


Field Summary
private  boolean m_registered
           
private  HTTPInstrumentSampleData[] m_sampleAry
           
private  java.util.Map m_sampleMap
           
private  java.util.List m_samples
           
private  int m_type
          The type of the Instrument.
 
Fields inherited from interface org.apache.excalibur.instrument.client.InstrumentData
INSTRUMENT_TYPE_COUNTER, INSTRUMENT_TYPE_NONE, INSTRUMENT_TYPE_VALUE
 
Constructor Summary
HTTPInstrumentData(HTTPInstrumentableData parent, java.lang.String name)
          Creates a new HTTPInstrumentData.
 
Method Summary
 boolean createInstrumentSample(java.lang.String description, long interval, int sampleCount, long leaseTime, int sampleType)
          Requests that a sample be created or that its lease be updated.
 InstrumentSampleData[] getInstrumentSamples()
          Returns an array of the Instrument Samples assigned to the Instrument.
 int getType()
          Returns the type of the Instrument.
 boolean isRegistered()
          Returns the registered flag of the remote object.
 boolean update()
          Causes the InstrumentData to update itself with the latest data from the server.
protected  void update(org.apache.avalon.framework.configuration.Configuration configuration, boolean recurse)
          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, update
 
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
 

Field Detail

m_registered

private boolean m_registered

m_type

private int m_type
The type of the Instrument.


m_samples

private java.util.List m_samples

m_sampleAry

private HTTPInstrumentSampleData[] m_sampleAry

m_sampleMap

private java.util.Map m_sampleMap
Constructor Detail

HTTPInstrumentData

HTTPInstrumentData(HTTPInstrumentableData parent,
                   java.lang.String name)
Creates a new HTTPInstrumentData.

Method Detail

update

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

Parameters:
configuration - Configuration object to load from.
recurse - True if state should be ignored and we should drill down using data in this configuration.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - If there are any problems.

update

public boolean update()
Causes the InstrumentData to update itself with the latest data from the server.

Specified by:
update in interface Data
Returns:
true if successful.

isRegistered

public boolean isRegistered()
Returns the registered flag of the remote object.

Specified by:
isRegistered in interface InstrumentData
Returns:
The registered flag of the remote object.

getType

public int getType()
Returns the type of the Instrument. Possible values include InstrumentData.INSTRUMENT_TYPE_COUNTER, InstrumentData.INSTRUMENT_TYPE_VALUE or InstrumentData.INSTRUMENT_TYPE_NONE, if the type was never set.

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

getInstrumentSamples

public InstrumentSampleData[] getInstrumentSamples()
Returns an array of the Instrument Samples assigned to the Instrument.

Specified by:
getInstrumentSamples in interface InstrumentData
Returns:
An array of Instrument Samples.

createInstrumentSample

public boolean createInstrumentSample(java.lang.String description,
                                      long interval,
                                      int sampleCount,
                                      long leaseTime,
                                      int sampleType)
Requests that a sample be created or that its lease be updated.

Specified by:
createInstrumentSample in interface InstrumentData
Parameters:
description - Description to assign to the new sample.
interval - Sample interval of the new sample.
sampleCount - Number of samples in the new sample.
leaseTime - Requested lease time. The server may not grant the full lease.
sampleType - The type of sample to be created.
Returns:
True if successful.