eu.reservoir.monitoring.core
Class AbstractProbe

java.lang.Object
  extended by eu.reservoir.monitoring.core.AbstractProbe
All Implemented Interfaces:
Probe, ProbeInfo, ProbeLifecycle, ProbeReporting, java.lang.Runnable
Direct Known Subclasses:
CPUInfo, HypervisorProbe, MemoryInfo, NetInfo, QueueLengthProbe, SAPUsersProbe, ThalesLogFileProbe

public abstract class AbstractProbe
extends java.lang.Object
implements Probe

An abstract probe.


Nested Class Summary
 
Nested classes/interfaces inherited from interface eu.reservoir.monitoring.core.Probe
Probe.CollectionType, Probe.ReportingType, Probe.Status
 
Constructor Summary
AbstractProbe()
          Construct a probe
 
Method Summary
 ProbeLifecycle activateProbe()
          Activate the probe
 Probe addProbeAttribute(ProbeAttribute attribute)
          Define an element of the data dictionary
 void beginThreadBody()
          The code to run at the begining of the thread body.
abstract  ProbeMeasurement collect()
          Collect a measurement for the reciever
 ProbeLifecycle deactivateProbe()
          Deactivate the probe
 void endThreadBody()
          The code to run at the end of the thread body.
 void error(MeasurementException me)
          Called when there is an error in a Measurement.
 ProbeAttribute getAttribute(int n)
          Get the ProbeAttribute with field no.
 java.util.Collection<ProbeAttribute> getAttributes()
          Get the Probe's Attributes.
 Probe.CollectionType getCollectionType()
          Get the CollectionType of this Probe.
 Rational getDataRate()
          Get the data rate The data rate is a Rational.
 ID getGroupID()
          Get the Group ID of the Probe.
 ID getID()
          Get the Probe ID
 Measurement getLastMeasurement()
          Get the last measurement that was collected.
 Timestamp getLastMeasurementCollection()
          Get the last time a measurement was collected.
 java.util.Map<java.lang.String,java.lang.Object> getMetaData()
          Get the probe meta data.
 java.lang.String getName()
          Get the name of the Probe
 ProbeFilter getProbeFilter()
          Get the current filter.
 ProbeManager getProbeManager()
          Get the manager of a Probe.
 ID getServiceID()
          Get the Service ID of the Probe.
 java.lang.Object inform(java.lang.Object obj)
          Inform the Probe of an object.
 boolean isActive()
          Has this probe been activated.
 boolean isFiltering()
          Is the probe filtering values.
 boolean isOn()
          Is this Probe turned on.
protected  long rationalToMillis(Rational rational)
          Convert the data rate to milliseconds
 void run()
          The thread run() method
 Probe setDataRate(Rational rate)
          Set the data rate The data rate is a Rational.
 Probe setGroupID(ID id)
          Set the Group ID for a Probe
 Probe setID(ID id)
          Set the Probe ID
 Probe setName(java.lang.String aName)
          Set the name of the Probe
 ProbeFilter setProbeFilter(ProbeFilter f)
          Set the current filter.
 ProbeLifecycle setProbeManager(ProbeManager pm)
          Set the manager of a Probe.
 Probe setServiceID(ID id)
          Set the Service ID for a Probe
protected  void startProbeThread()
          Activate the probe by starting the probe thread.
protected  void stopProbeThread()
          Deactivate the probe by stopping the probe thread.
 java.lang.String toString()
          To String
 ProbeReporting turnOffFiltering()
          Turn off filtering.
 ProbeLifecycle turnOffProbe()
          Turn off the probe
 ProbeReporting turnOnFiltering()
          Turn on filtering.
 ProbeLifecycle turnOnProbe()
          Turn on the probe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractProbe

public AbstractProbe()
Construct a probe

Method Detail

getName

public java.lang.String getName()
Description copied from interface: ProbeInfo
Get the name of the Probe

Specified by:
getName in interface ProbeInfo

setName

public Probe setName(java.lang.String aName)
Description copied from interface: ProbeInfo
Set the name of the Probe

Specified by:
setName in interface ProbeInfo

getID

public ID getID()
Get the Probe ID

Specified by:
getID in interface ProbeInfo

setID

public Probe setID(ID id)
Set the Probe ID

Specified by:
setID in interface ProbeInfo

isOn

public boolean isOn()
Is this Probe turned on. The thread is running, but is the Probe getting values.

Specified by:
isOn in interface ProbeLifecycle

isActive

public boolean isActive()
Has this probe been activated. Is the thread associated with a Probe acutally running.

Specified by:
isActive in interface ProbeLifecycle

getServiceID

public ID getServiceID()
Get the Service ID of the Probe.

Specified by:
getServiceID in interface ProbeInfo

setServiceID

public Probe setServiceID(ID id)
Set the Service ID for a Probe

Specified by:
setServiceID in interface ProbeInfo

getGroupID

public ID getGroupID()
Get the Group ID of the Probe.

Specified by:
getGroupID in interface ProbeInfo

setGroupID

public Probe setGroupID(ID id)
Set the Group ID for a Probe

Specified by:
setGroupID in interface ProbeInfo

getMetaData

public java.util.Map<java.lang.String,java.lang.Object> getMetaData()
Get the probe meta data. Returns a map of probe attributes, e.g [name: "memory", dataRate: 720/1, active: true, on: false]

Specified by:
getMetaData in interface ProbeInfo

getProbeManager

public ProbeManager getProbeManager()
Get the manager of a Probe.

Specified by:
getProbeManager in interface ProbeInfo

setProbeManager

public ProbeLifecycle setProbeManager(ProbeManager pm)
Set the manager of a Probe.

Specified by:
setProbeManager in interface ProbeInfo

getDataRate

public Rational getDataRate()
Get the data rate The data rate is a Rational. Specified in measurements per hour

Specified by:
getDataRate in interface ProbeInfo

getLastMeasurement

public Measurement getLastMeasurement()
Get the last measurement that was collected.

Specified by:
getLastMeasurement in interface ProbeInfo

getLastMeasurementCollection

public Timestamp getLastMeasurementCollection()
Get the last time a measurement was collected.

Specified by:
getLastMeasurementCollection in interface ProbeInfo

addProbeAttribute

public Probe addProbeAttribute(ProbeAttribute attribute)
Define an element of the data dictionary

Specified by:
addProbeAttribute in interface ProbeInfo

getAttributes

public java.util.Collection<ProbeAttribute> getAttributes()
Get the Probe's Attributes.

Specified by:
getAttributes in interface ProbeInfo

getAttribute

public ProbeAttribute getAttribute(int n)
Get the ProbeAttribute with field no. N.

Specified by:
getAttribute in interface ProbeInfo

getCollectionType

public Probe.CollectionType getCollectionType()
Get the CollectionType of this Probe. Either one of AtDataRate or OnEvent


setDataRate

public Probe setDataRate(Rational rate)
Set the data rate The data rate is a Rational. Specified in measurements per hour

Specified by:
setDataRate in interface ProbeInfo

getProbeFilter

public ProbeFilter getProbeFilter()
Get the current filter.

Specified by:
getProbeFilter in interface ProbeReporting

setProbeFilter

public ProbeFilter setProbeFilter(ProbeFilter f)
Set the current filter. Returns the previous filter.

Specified by:
setProbeFilter in interface ProbeReporting

turnOnFiltering

public ProbeReporting turnOnFiltering()
Turn on filtering.

Specified by:
turnOnFiltering in interface ProbeReporting

turnOffFiltering

public ProbeReporting turnOffFiltering()
Turn off filtering.

Specified by:
turnOffFiltering in interface ProbeReporting

isFiltering

public boolean isFiltering()
Is the probe filtering values.

Specified by:
isFiltering in interface ProbeReporting

turnOnProbe

public ProbeLifecycle turnOnProbe()
Turn on the probe

Specified by:
turnOnProbe in interface ProbeLifecycle

turnOffProbe

public ProbeLifecycle turnOffProbe()
Turn off the probe

Specified by:
turnOffProbe in interface ProbeLifecycle

activateProbe

public ProbeLifecycle activateProbe()
Activate the probe

Specified by:
activateProbe in interface ProbeLifecycle

deactivateProbe

public ProbeLifecycle deactivateProbe()
Deactivate the probe

Specified by:
deactivateProbe in interface ProbeLifecycle

startProbeThread

protected void startProbeThread()
Activate the probe by starting the probe thread.


stopProbeThread

protected void stopProbeThread()
Deactivate the probe by stopping the probe thread.


collect

public abstract ProbeMeasurement collect()
Collect a measurement for the reciever

Specified by:
collect in interface ProbeReporting

inform

public java.lang.Object inform(java.lang.Object obj)
Inform the Probe of an object. This turns the Probe on so it calls collect().

Specified by:
inform in interface ProbeReporting

error

public void error(MeasurementException me)
Called when there is an error in a Measurement.

Specified by:
error in interface ProbeReporting

run

public void run()
The thread run() method

Specified by:
run in interface java.lang.Runnable

beginThreadBody

public void beginThreadBody()
The code to run at the begining of the thread body. Used to set things up.


endThreadBody

public void endThreadBody()
The code to run at the end of the thread body. Used to tidy things up.


rationalToMillis

protected long rationalToMillis(Rational rational)
Convert the data rate to milliseconds


toString

public java.lang.String toString()
To String

Overrides:
toString in class java.lang.Object


RESERVOIR Monitoring 0.6.4