org.ow2.jasmine.probe.collectors.df.internal
Class DfCollector

java.lang.Object
  extended by org.ow2.jasmine.probe.collectors.JCollector
      extended by org.ow2.jasmine.probe.collectors.df.internal.DfCollector
All Implemented Interfaces:
JasmineCollector

public class DfCollector
extends JCollector

Collector implementation for df. This implementation works with a separate thread used to pre collect the results. A simpler implementation could be done by not using a thread. Using a thread is interesting when we do not want to be stuck in case info cannot be got.

Author:
durieuxp

Field Summary
 
Fields inherited from class org.ow2.jasmine.probe.collectors.JCollector
hostName, indicator, logger, period, probeId, probeManager
 
Constructor Summary
DfCollector(String probeId, JasmineIndicator indicator, int period)
          Constructor
 
Method Summary
 void addResult(JasmineIndicatorValue value)
          Add a new result to the list.
 Collection<String> getDiskList()
          Get the disk to be observed null if we are interested on all disks
 JasmineIndicatorValue getLastResult()
          Retrieve the last results for this indicator This method return a List of results in case indicator represents actually a list of value (for example: df for ALL the disks)
 boolean needResult()
          Check if this Collector needs a new result.
 void startPolling()
          Restart polling
 void stopPolling()
          Stop polling
 
Methods inherited from class org.ow2.jasmine.probe.collectors.JCollector
addJsr, addLongJsr, addLongValues, addValues, averageJsr, diffJsr, diffLongValues, diffValues, divideJsr, divideLongValues, divideValues, getDomainName, getIndicator, getIndicatorName, getProbeId, getServerName, isRemoved, jsrProps, longValue, maxJsr, minJsr, multiplyJsr, multiplyLongValues, multiplyValues, remove, setProbeManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DfCollector

public DfCollector(String probeId,
                   JasmineIndicator indicator,
                   int period)
Constructor

Parameters:
indicator - definition
Method Detail

getDiskList

public Collection<String> getDiskList()
Get the disk to be observed null if we are interested on all disks

Returns:

getLastResult

public JasmineIndicatorValue getLastResult()
                                    throws JasmineCollectorException
Retrieve the last results for this indicator This method return a List of results in case indicator represents actually a list of value (for example: df for ALL the disks)

Specified by:
getLastResult in interface JasmineCollector
Specified by:
getLastResult in class JCollector
Returns:
List of JasmineIndicatorValue
Throws:
JasmineCollectorException

stopPolling

public void stopPolling()
Stop polling

Specified by:
stopPolling in interface JasmineCollector
Specified by:
stopPolling in class JCollector

startPolling

public void startPolling()
Restart polling

Specified by:
startPolling in interface JasmineCollector
Specified by:
startPolling in class JCollector

needResult

public boolean needResult()
Check if this Collector needs a new result. A stopped collector returns false. Otherwise, it returns true if the cache is empty or outdated regarding to the poll period and the OBSOLATE_TIME constant.

Returns:
true if it needs one

addResult

public void addResult(JasmineIndicatorValue value)
Add a new result to the list.

Parameters:
value -


Copyright © 2012 OW2 Consortium. All Rights Reserved.