eu.reservoir.monitoring.core
Class DefaultDataSourceDelegate

java.lang.Object
  extended by eu.reservoir.monitoring.core.AbstractPlaneInteracter
      extended by eu.reservoir.monitoring.core.DefaultDataSourceDelegate
All Implemented Interfaces:
DataSourceDelegate, DataSourceInteracter, ControlService, DataService, InfoService, PlaneInteracter

public class DefaultDataSourceDelegate
extends AbstractPlaneInteracter
implements DataSourceDelegate

A DataSourceDelegate is a delegate for a DataSource that sends interacts with the data plane, info plane, and control plane. It's role is to insulate the DataSource and the Probes from the real implementations of the Planes.


Constructor Summary
DefaultDataSourceDelegate(DataSource ds)
          Construct a DataSourceDelegate.
 
Method Summary
 boolean activateProbe(ID probeID)
          Activate the probe
 boolean addDataSourceInfo(DataSource ds)
          Add DataSource info to the InfoPlane.
 boolean addProbeAttributeInfo(Probe p, ProbeAttribute pa)
          Add ProbeAttribute info to the InfoPlane.
 boolean addProbeInfo(Probe p)
          Add Probe info to the InfoPlane.
 boolean deactivateProbe(ID probeID)
          Deactivate the probe
 DataSource getDataSource()
          Get the DataSource this is a delegate for.
 java.lang.String getDataSourceName()
          Get the name of the DataSource
 java.lang.Object getInfo(java.lang.String key)
          Get a value from the InfoPlane.
 Rational getProbeDataRate(ID probeID)
          Get the data rate for a Probe The data rate is a Rational.
 ID getProbeGroupID(ID probeID)
          Get the Group ID of the Probe.
 Measurement getProbeLastMeasurement(ID probeID)
          Get the last measurement that was collected.
 Timestamp getProbeLastMeasurementCollection(ID probeID)
          Get the last time a measurement was collected.
 java.lang.String getProbeName(ID probeID)
          Get the name of the Probe
 ID getProbeServiceID(ID probeID)
          Get the Service ID of the Probe.
 boolean isProbeActive(ID probeID)
          Has this probe been activated.
 boolean isProbeOn(ID probeID)
          Is this Probe turned on.
 java.lang.Object lookupDataSourceInfo(DataSource dataSource, java.lang.String info)
          Lookup some DataSource info in the InfoPlane.
 java.lang.Object lookupDataSourceInfo(ID dataSourceID, java.lang.String info)
          Lookup some DataSource info in the InfoPlane.
 java.lang.Object lookupProbeAttributeInfo(ID probeID, int field, java.lang.String info)
          Lookup some ProbeAttribute info in the InfoPlane.
 java.lang.Object lookupProbeAttributeInfo(Probe probe, int field, java.lang.String info)
          Lookup some ProbeAttribute info in the InfoPlane.
 java.lang.Object lookupProbeInfo(ID probeID, java.lang.String info)
          Lookup some Probe info in the InfoPlane.
 java.lang.Object lookupProbeInfo(Probe probe, java.lang.String info)
          Lookup some Probe info in the InfoPlane.
 boolean modifyDataSourceInfo(DataSource ds)
          Modify DataSource Info.
 boolean modifyProbeAttributeInfo(Probe p, ProbeAttribute pa)
          Modify ProbeAttribute Info for a Probe.
 boolean modifyProbeInfo(Probe p)
          Modify Probe Info.
 boolean putInfo(java.lang.String key, java.io.Serializable value)
          Put a value in the InfoPlane.
 boolean removeDataSourceInfo(DataSource ds)
          Remove DataSource info from the InfoPlane.
 boolean removeInfo(java.lang.String key)
          Remove a value from the InfoPlane.
 boolean removeProbeAttributeInfo(Probe p, ProbeAttribute pa)
          Remove ProbeAttribute info from the InfoPlane.
 boolean removeProbeInfo(Probe p)
          Remove Probe info from the InfoPlane.
 int sendData(DataPlaneMessage dpm)
          Send a message.
 boolean sentData(int id)
          This method is called just after a message has been sent to the underlying transport.
 PlaneInteracter setControlPlane(ControlPlane controlPlane)
          Set the ControlPlane this is a delegate for.
 PlaneInteracter setDataPlane(DataPlane dataPlane)
          Set the DataPlane this is a delegate for.
 DataSource setDataSource(DataSource ds)
          Set the DataSource this is a delegate for.
 boolean setDataSourceName(java.lang.String name)
          Set the name of the DataSource
 PlaneInteracter setInfoPlane(InfoPlane infoPlane)
          Set the InfoPlane this is a delegate for.
 boolean setProbeDataRate(ID probeID, Rational dataRate)
          Set the data rate for a Probe The data rate is a Rational.
 boolean setProbeGroupID(ID probeID, ID id)
          Set the Group ID for a Probe
 boolean setProbeName(ID probeID, java.lang.String name)
          Set the name of the Probe
 boolean setProbeServiceID(ID probeID, ID id)
          Set the Service ID for a Probe
 boolean turnOffProbe(ID probeID)
          Turn off a Probe
 boolean turnOnProbe(ID probeID)
          Turn on a Probe
 
Methods inherited from class eu.reservoir.monitoring.core.AbstractPlaneInteracter
announce, connect, dennounce, disconnect, getControlPlane, getDataPlane, getInfoPlane, isConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.reservoir.monitoring.core.PlaneInteracter
connect, disconnect, getControlPlane, getDataPlane, getInfoPlane, isConnected
 

Constructor Detail

DefaultDataSourceDelegate

public DefaultDataSourceDelegate(DataSource ds)
Construct a DataSourceDelegate.

Method Detail

getDataSource

public DataSource getDataSource()
Get the DataSource this is a delegate for.

Specified by:
getDataSource in interface DataSourceInteracter

setDataSource

public DataSource setDataSource(DataSource ds)
Set the DataSource this is a delegate for.

Specified by:
setDataSource in interface DataSourceInteracter

setDataPlane

public PlaneInteracter setDataPlane(DataPlane dataPlane)
Set the DataPlane this is a delegate for.

Specified by:
setDataPlane in interface PlaneInteracter
Overrides:
setDataPlane in class AbstractPlaneInteracter

setControlPlane

public PlaneInteracter setControlPlane(ControlPlane controlPlane)
Set the ControlPlane this is a delegate for.

Specified by:
setControlPlane in interface PlaneInteracter
Overrides:
setControlPlane in class AbstractPlaneInteracter

setInfoPlane

public PlaneInteracter setInfoPlane(InfoPlane infoPlane)
Set the InfoPlane this is a delegate for.

Specified by:
setInfoPlane in interface PlaneInteracter
Overrides:
setInfoPlane in class AbstractPlaneInteracter

sendData

public int sendData(DataPlaneMessage dpm)
             throws java.lang.Exception
Send a message.

Specified by:
sendData in interface DataService
Returns:
-1 if something goes wrong
Throws:
java.lang.Exception

sentData

public boolean sentData(int id)
This method is called just after a message has been sent to the underlying transport.

Specified by:
sentData in interface DataService

lookupDataSourceInfo

public java.lang.Object lookupDataSourceInfo(DataSource dataSource,
                                             java.lang.String info)
Lookup some DataSource info in the InfoPlane.

Specified by:
lookupDataSourceInfo in interface InfoService

lookupDataSourceInfo

public java.lang.Object lookupDataSourceInfo(ID dataSourceID,
                                             java.lang.String info)
Lookup some DataSource info in the InfoPlane. Mostly used at the management end, as it uses DataSource ID.

Specified by:
lookupDataSourceInfo in interface InfoService

lookupProbeInfo

public java.lang.Object lookupProbeInfo(Probe probe,
                                        java.lang.String info)
Lookup some Probe info in the InfoPlane.

Specified by:
lookupProbeInfo in interface InfoService

lookupProbeInfo

public java.lang.Object lookupProbeInfo(ID probeID,
                                        java.lang.String info)
Lookup some Probe info in the InfoPlane. Mostly used at the management end, as it uses Probe ID.

Specified by:
lookupProbeInfo in interface InfoService

lookupProbeAttributeInfo

public java.lang.Object lookupProbeAttributeInfo(Probe probe,
                                                 int field,
                                                 java.lang.String info)
Lookup some ProbeAttribute info in the InfoPlane.

Specified by:
lookupProbeAttributeInfo in interface InfoService

lookupProbeAttributeInfo

public java.lang.Object lookupProbeAttributeInfo(ID probeID,
                                                 int field,
                                                 java.lang.String info)
Lookup some ProbeAttribute info in the InfoPlane. Mostly used at the management end, as it uses Probe ID.

Specified by:
lookupProbeAttributeInfo in interface InfoService

addDataSourceInfo

public boolean addDataSourceInfo(DataSource ds)
Add DataSource info to the InfoPlane.

Specified by:
addDataSourceInfo in interface InfoService

addProbeInfo

public boolean addProbeInfo(Probe p)
Add Probe info to the InfoPlane.

Specified by:
addProbeInfo in interface InfoService

addProbeAttributeInfo

public boolean addProbeAttributeInfo(Probe p,
                                     ProbeAttribute pa)
Add ProbeAttribute info to the InfoPlane.

Specified by:
addProbeAttributeInfo in interface InfoService

modifyDataSourceInfo

public boolean modifyDataSourceInfo(DataSource ds)
Modify DataSource Info.

Specified by:
modifyDataSourceInfo in interface InfoService

modifyProbeInfo

public boolean modifyProbeInfo(Probe p)
Modify Probe Info.

Specified by:
modifyProbeInfo in interface InfoService

modifyProbeAttributeInfo

public boolean modifyProbeAttributeInfo(Probe p,
                                        ProbeAttribute pa)
Modify ProbeAttribute Info for a Probe.

Specified by:
modifyProbeAttributeInfo in interface InfoService

removeDataSourceInfo

public boolean removeDataSourceInfo(DataSource ds)
Remove DataSource info from the InfoPlane.

Specified by:
removeDataSourceInfo in interface InfoService

removeProbeInfo

public boolean removeProbeInfo(Probe p)
Remove Probe info from the InfoPlane.

Specified by:
removeProbeInfo in interface InfoService

removeProbeAttributeInfo

public boolean removeProbeAttributeInfo(Probe p,
                                        ProbeAttribute pa)
Remove ProbeAttribute info from the InfoPlane.

Specified by:
removeProbeAttributeInfo in interface InfoService

putInfo

public boolean putInfo(java.lang.String key,
                       java.io.Serializable value)
Put a value in the InfoPlane.

Specified by:
putInfo in interface InfoService

getInfo

public java.lang.Object getInfo(java.lang.String key)
Get a value from the InfoPlane.

Specified by:
getInfo in interface InfoService

removeInfo

public boolean removeInfo(java.lang.String key)
Remove a value from the InfoPlane.

Specified by:
removeInfo in interface InfoService

getProbeName

public java.lang.String getProbeName(ID probeID)
Get the name of the Probe

Specified by:
getProbeName in interface ControlService

setProbeName

public boolean setProbeName(ID probeID,
                            java.lang.String name)
Set the name of the Probe

Specified by:
setProbeName in interface ControlService

getProbeServiceID

public ID getProbeServiceID(ID probeID)
Get the Service ID of the Probe.

Specified by:
getProbeServiceID in interface ControlService

setProbeServiceID

public boolean setProbeServiceID(ID probeID,
                                 ID id)
Set the Service ID for a Probe

Specified by:
setProbeServiceID in interface ControlService

getProbeGroupID

public ID getProbeGroupID(ID probeID)
Get the Group ID of the Probe.

Specified by:
getProbeGroupID in interface ControlService

setProbeGroupID

public boolean setProbeGroupID(ID probeID,
                               ID id)
Set the Group ID for a Probe

Specified by:
setProbeGroupID in interface ControlService

getProbeDataRate

public Rational getProbeDataRate(ID probeID)
Get the data rate for a Probe The data rate is a Rational. Specified in measurements per hour

Specified by:
getProbeDataRate in interface ControlService

setProbeDataRate

public boolean setProbeDataRate(ID probeID,
                                Rational dataRate)
Set the data rate for a Probe The data rate is a Rational. Specified in measurements per hour

Specified by:
setProbeDataRate in interface ControlService

getProbeLastMeasurement

public Measurement getProbeLastMeasurement(ID probeID)
Get the last measurement that was collected.

Specified by:
getProbeLastMeasurement in interface ControlService

getProbeLastMeasurementCollection

public Timestamp getProbeLastMeasurementCollection(ID probeID)
Get the last time a measurement was collected.

Specified by:
getProbeLastMeasurementCollection in interface ControlService

turnOnProbe

public boolean turnOnProbe(ID probeID)
Turn on a Probe

Specified by:
turnOnProbe in interface ControlService

turnOffProbe

public boolean turnOffProbe(ID probeID)
Turn off a Probe

Specified by:
turnOffProbe in interface ControlService

isProbeOn

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

Specified by:
isProbeOn in interface ControlService

activateProbe

public boolean activateProbe(ID probeID)
Activate the probe

Specified by:
activateProbe in interface ControlService

deactivateProbe

public boolean deactivateProbe(ID probeID)
Deactivate the probe

Specified by:
deactivateProbe in interface ControlService

isProbeActive

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

Specified by:
isProbeActive in interface ControlService

getDataSourceName

public java.lang.String getDataSourceName()
Get the name of the DataSource

Specified by:
getDataSourceName in interface ControlService

setDataSourceName

public boolean setDataSourceName(java.lang.String name)
Set the name of the DataSource

Specified by:
setDataSourceName in interface ControlService


RESERVOIR Monitoring 0.6.4