eu.reservoir.monitoring.distribution.udp
Class AbstractUDPDataPlaneConsumer

java.lang.Object
  extended by eu.reservoir.monitoring.distribution.udp.AbstractUDPDataPlaneConsumer
All Implemented Interfaces:
MeasurementReceiver, MeasurementReporting, DataPlane, DataService, Plane, Receiving
Direct Known Subclasses:
UDPDataPlaneConsumerNoNames, UDPDataPlaneConsumerWithNames

public abstract class AbstractUDPDataPlaneConsumer
extends java.lang.Object
implements DataPlane, MeasurementReporting, Receiving


Constructor Summary
AbstractUDPDataPlaneConsumer(java.net.InetSocketAddress addr)
          Construct a AbstractUDPDataPlaneConsumer.
 
Method Summary
 boolean announce()
          Announce that the plane is up and running
 boolean connect()
          Connect to a delivery mechansim.
 boolean dennounce()
          Un-announce that the plane is up and running
 boolean disconnect()
          Dicconnect from a delivery mechansim.
 void error(java.lang.Exception e)
          This method is called just after there has been an error in received from some underlying transport.
abstract  void received(java.io.ByteArrayInputStream bis, MetaData metaData)
          This method is called just after a packet has been received from some underlying transport at a particular address.
 Measurement report(Measurement m)
          Receiver of a measurment, with an extra object that has context info
 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.
 java.lang.Object setMeasurementReceiver(MeasurementReceiver mr)
          Set the object that will recieve the measurements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUDPDataPlaneConsumer

public AbstractUDPDataPlaneConsumer(java.net.InetSocketAddress addr)
Construct a AbstractUDPDataPlaneConsumer.

Method Detail

connect

public boolean connect()
Connect to a delivery mechansim.

Specified by:
connect in interface Plane

disconnect

public boolean disconnect()
Dicconnect from a delivery mechansim.

Specified by:
disconnect in interface Plane

announce

public boolean announce()
Announce that the plane is up and running

Specified by:
announce in interface Plane

dennounce

public boolean dennounce()
Un-announce that the plane is up and running

Specified by:
dennounce in interface Plane

received

public abstract void received(java.io.ByteArrayInputStream bis,
                              MetaData metaData)
                       throws java.io.IOException,
                              TypeException
This method is called just after a packet has been received from some underlying transport at a particular address. The expected message is XDR encoded and it's structure is: +-------------------------------------------------------------------+ | data source id (long) | msg type (int) | seq no (int) | payload | +-------------------------------------------------------------------+

Specified by:
received in interface Receiving
Throws:
java.io.IOException
TypeException

error

public void error(java.lang.Exception e)
This method is called just after there has been an error in received from some underlying transport. This passes the exception into the Receiving object.

Specified by:
error in interface Receiving

sendData

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

Specified by:
sendData in interface DataService
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

report

public Measurement report(Measurement m)
Receiver of a measurment, with an extra object that has context info

Specified by:
report in interface MeasurementReceiver

setMeasurementReceiver

public java.lang.Object setMeasurementReceiver(MeasurementReceiver mr)
Set the object that will recieve the measurements.

Specified by:
setMeasurementReceiver in interface MeasurementReporting


RESERVOIR Monitoring 0.6.4