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

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

 class HTTPInstrumentManagerData
extends AbstractHTTPData
implements InstrumentManagerData


Field Summary
private  boolean m_batchedUpdates
           
private  HTTPInstrumentableData[] m_instrumentableAry
           
private  java.util.Map m_instrumentableMap
           
private  java.util.List m_instrumentables
           
private  java.lang.String m_name
           
private  boolean m_readOnly
           
 
Constructor Summary
HTTPInstrumentManagerData(HTTPInstrumentManagerConnection connection)
          Creates a new HTTPInstrumentManagerData.
 
Method Summary
 void createInstrumentSample(java.lang.String instrumentName, java.lang.String description, long interval, int sampleCount, long leaseTime, int sampleType)
          Requests that a sample be created or that its lease be updated.
 void createInstrumentSamples(java.lang.String[] instrumentNames, java.lang.String[] descriptions, long[] intervals, int[] sampleCounts, long[] leaseTimes, int[] sampleTypes)
          Requests that a set of samples be created or that their leases be updated.
 InstrumentableData[] getInstrumentables()
          Gets a thread-safe snapshot of the instrumentable list.
 java.lang.String getName()
          Returns the name.
 boolean isReadOnly()
          Returns true if the InstrumentManager on the server is operating in read-only mode.
private  boolean isSupportsBatchedUpdates()
          Returns true if batched lease creates and renewals are implemented on the server.
 boolean update()
          Causes the InstrumentManagerData 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.
 boolean updateAll()
          Causes the the entire instrument tree to be updated in one call.
 
Methods inherited from class org.apache.excalibur.instrument.client.http.AbstractHTTPData
getConnection, getDescription, getStateVersion, update, 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.Data
getDescription, getStateVersion
 

Field Detail

m_name

private java.lang.String m_name

m_batchedUpdates

private boolean m_batchedUpdates

m_readOnly

private boolean m_readOnly

m_instrumentables

private java.util.List m_instrumentables

m_instrumentableAry

private HTTPInstrumentableData[] m_instrumentableAry

m_instrumentableMap

private java.util.Map m_instrumentableMap
Constructor Detail

HTTPInstrumentManagerData

HTTPInstrumentManagerData(HTTPInstrumentManagerConnection connection)
Creates a new HTTPInstrumentManagerData.

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 InstrumentManagerData to update itself with the latest data from the server.

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

getName

public java.lang.String getName()
Returns the name.

Specified by:
getName in interface InstrumentManagerData
Returns:
The name.

isReadOnly

public boolean isReadOnly()
Returns true if the InstrumentManager on the server is operating in read-only mode.

Returns:
True if read-only.
Since:
1.2

isSupportsBatchedUpdates

private boolean isSupportsBatchedUpdates()
Returns true if batched lease creates and renewals are implemented on the server.

Returns:
True if read-only.
Since:
1.2

getInstrumentables

public InstrumentableData[] getInstrumentables()
Gets a thread-safe snapshot of the instrumentable list.

Specified by:
getInstrumentables in interface InstrumentManagerData
Returns:
A thread-safe snapshot of the instrumentable list.

updateAll

public boolean updateAll()
Causes the the entire instrument tree to be updated in one call. Very fast when it is known that all or most data has changed.

Specified by:
updateAll in interface InstrumentManagerData
Returns:
true if successful.

createInstrumentSample

public void createInstrumentSample(java.lang.String instrumentName,
                                   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 InstrumentManagerData
Parameters:
instrumentName - The full name of the instrument whose sample is to be created or updated.
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.

createInstrumentSamples

public void createInstrumentSamples(java.lang.String[] instrumentNames,
                                    java.lang.String[] descriptions,
                                    long[] intervals,
                                    int[] sampleCounts,
                                    long[] leaseTimes,
                                    int[] sampleTypes)
Requests that a set of samples be created or that their leases be updated. All array parameters must be of the same length.

Specified by:
createInstrumentSamples in interface InstrumentManagerData
Parameters:
instrumentNames - The full names of the instruments whose sample are to be created or updated.
descriptions - Descriptions to assign to the new samples.
intervals - Sample intervals of the new samples.
sampleCounts - Number of samples in each the new samples.
leaseTimes - Requested lease times. The server may not grant the full leases.
sampleTypes - The types of samples to be created.