org.glite.ce.monitorapij.sensor
Interface Sensor

All Known Implementing Classes:
AbstractSensor

public interface Sensor

This interface must be implemented by all monitor sensors.

Author:
Luigi Zangrando (zangrando@pd.infn.it)

Method Summary
 void addFormat(SensorOutputDataFormat format)
          Add a format to the list of Sensor's supported formats.
 void addSensorListener(SensorListener sIf)
          Add a SensorListener interested to notifications regarding MonitorEvents of this Sensor.
 void destroySensor()
          Destroy this Sensor.
 void execute()
          Execute this Sensor.
 SensorOutputDataFormat getDefaultFormat()
          Get the default format.
 SensorOutputDataFormat getFormat(java.lang.String name)
          Get the SensorOutputDataFormat format specified by its name.
 SensorOutputDataFormat[] getFormats()
          Get an array of all supported format.
 java.lang.String getName()
          Get the sensor's name.
 SensorListener[] getSensorListeners()
          Get the all SensorListener s registered to this Sensor.
 java.lang.String getType()
          Get the sensor's type.
 void init()
          Initialize this Sensor.
 boolean isFormatSupported(SensorOutputDataFormat format)
          Check if specified format is supported by the Sensor i.e.
 boolean isFormatSupported(java.lang.String format)
          Check if the SensorOutputDataFormat specified by its name is supported by the Sensor, i.e.
 void removeFormat(SensorOutputDataFormat format)
          Remove a format from the list of Sensor's supported formats.
 void removeSensorListener(SensorListener sIf)
          Remove a SensorListener from the list of listeners interested to notifications regarding MonitorEvents of this Sensor.
 void resumeSensor()
          Resume the execution of this Sensor.
 void setDefaultFormat(SensorOutputDataFormat format)
          Set the default format.
 void startSensor()
          Start the execution of this Sensor.
 void suspendSensor()
          Suspend the execution of this Sensor.
 

Method Detail

getName

public java.lang.String getName()
Get the sensor's name.

Returns:
A String representing the sensor's name

getType

public java.lang.String getType()
Get the sensor's type.

Returns:
A String representing the sensor's type

getFormat

public SensorOutputDataFormat getFormat(java.lang.String name)
Get the SensorOutputDataFormat format specified by its name.

Parameters:
name - The name of the SensorOutputDataFormat format.
Returns:
The SensorOutputDataFormat named as required.

getFormats

public SensorOutputDataFormat[] getFormats()
Get an array of all supported format.

Returns:
An array of SensorOutputDataFormat representing the all supported formats.

addFormat

public void addFormat(SensorOutputDataFormat format)
Add a format to the list of Sensor's supported formats.

Parameters:
format - The SensorOutputDataFormat to be added.

removeFormat

public void removeFormat(SensorOutputDataFormat format)
Remove a format from the list of Sensor's supported formats.

Parameters:
format - The SensorOutputDataFormat to be removed.

setDefaultFormat

public void setDefaultFormat(SensorOutputDataFormat format)
Set the default format.

Parameters:
format - Then SensorOutputDataFormat which is the format to be set as default.

getDefaultFormat

public SensorOutputDataFormat getDefaultFormat()
Get the default format.

Returns:
The SensorOutputDataFormat which represents the default format.

isFormatSupported

public boolean isFormatSupported(SensorOutputDataFormat format)
Check if specified format is supported by the Sensor i.e. has already been added.

Parameters:
format - The SensorOutputDataFormat to check.
Returns:
A boolean: true if the specified format is supported, false otherwise.

isFormatSupported

public boolean isFormatSupported(java.lang.String format)
Check if the SensorOutputDataFormat specified by its name is supported by the Sensor, i.e. has already been added.

Parameters:
format - The String representing the name of the SensorOutputDataFormat to be checked.
Returns:
A boolean: true if the format specified is supported, false otherwise.

addSensorListener

public void addSensorListener(SensorListener sIf)
Add a SensorListener interested to notifications regarding MonitorEvents of this Sensor.

Parameters:
sIf - The SensorListener to add.

removeSensorListener

public void removeSensorListener(SensorListener sIf)
Remove a SensorListener from the list of listeners interested to notifications regarding MonitorEvents of this Sensor.

Parameters:
sIf - The SensorListener to be removed.

getSensorListeners

public SensorListener[] getSensorListeners()
Get the all SensorListener s registered to this Sensor.

Returns:
An array of the all SensorListener s registered to this Sensor.

init

public void init()
          throws SensorException
Initialize this Sensor.

Throws:
SensorException

startSensor

public void startSensor()
Start the execution of this Sensor.


suspendSensor

public void suspendSensor()
Suspend the execution of this Sensor.


resumeSensor

public void resumeSensor()
Resume the execution of this Sensor.


destroySensor

public void destroySensor()
Destroy this Sensor.


execute

public void execute()
             throws SensorException
Execute this Sensor.

Throws:
SensorException