eu.reservoir.monitoring.im.dht
Class IMNode

java.lang.Object
  extended by eu.reservoir.monitoring.im.dht.IMNode

public class IMNode
extends java.lang.Object

An IMNode is responsible for converting DataSource and Probe attributes into Hashtable keys and values for the DistributedHashTable.

For example, with a given DataSource you get:

and with a given Probe you get:


Constructor Summary
IMNode(int myPort, java.lang.String remHost, int remPort)
          Construct an IMNode, given a local port and a remote host and a remote port.
 
Method Summary
 IMNode addDataSource(DataSource ds)
          Add data for a DataSource
 IMNode addProbe(Probe aProbe)
          Add data for a Probe.
 IMNode addProbeAttribute(Probe aProbe, ProbeAttribute attr)
          Add data for a ProbeAttribute.
 boolean connect()
          Connect to the DHT peers.
 boolean disconnect()
          Disconnect from the DHT peers.
 java.lang.Object getDataSourceInfo(ID dsID, java.lang.String info)
          Lookup DataSource info
 java.lang.Object getDHT(java.lang.String aKey)
          Lookup info directly from the DHT.
 java.lang.Object getProbeAttributeInfo(ID probeID, int field, java.lang.String info)
          Lookup probe attribute details.
 java.lang.Object getProbeInfo(ID probeID, java.lang.String info)
          Lookup probe details.
 IMNode modifyDataSource(DataSource ds)
           
 IMNode modifyProbe(Probe p)
           
 IMNode modifyProbeAttribute(Probe p, ProbeAttribute pa)
           
 boolean putDHT(java.lang.String aKey, java.io.Serializable aValue)
          Put stuff into DHT.
 boolean remDHT(java.lang.String aKey)
          Remove info from the DHT.
 IMNode removeDataSource(DataSource ds)
           
 IMNode removeProbe(Probe aProbe)
           
 IMNode removeProbeAttribute(Probe aProbe, ProbeAttribute attr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IMNode

public IMNode(int myPort,
              java.lang.String remHost,
              int remPort)
Construct an IMNode, given a local port and a remote host and a remote port.

Method Detail

connect

public boolean connect()
Connect to the DHT peers.


disconnect

public boolean disconnect()
Disconnect from the DHT peers.


addDataSource

public IMNode addDataSource(DataSource ds)
                     throws java.io.IOException
Add data for a DataSource

Throws:
java.io.IOException

addProbe

public IMNode addProbe(Probe aProbe)
                throws java.io.IOException
Add data for a Probe.

Throws:
java.io.IOException

addProbeAttribute

public IMNode addProbeAttribute(Probe aProbe,
                                ProbeAttribute attr)
                         throws java.io.IOException
Add data for a ProbeAttribute.

Throws:
java.io.IOException

modifyDataSource

public IMNode modifyDataSource(DataSource ds)
                        throws java.io.IOException
Throws:
java.io.IOException

modifyProbe

public IMNode modifyProbe(Probe p)
                   throws java.io.IOException
Throws:
java.io.IOException

modifyProbeAttribute

public IMNode modifyProbeAttribute(Probe p,
                                   ProbeAttribute pa)
                            throws java.io.IOException
Throws:
java.io.IOException

removeDataSource

public IMNode removeDataSource(DataSource ds)
                        throws java.io.IOException
Throws:
java.io.IOException

removeProbe

public IMNode removeProbe(Probe aProbe)
                   throws java.io.IOException
Throws:
java.io.IOException

removeProbeAttribute

public IMNode removeProbeAttribute(Probe aProbe,
                                   ProbeAttribute attr)
                            throws java.io.IOException
Throws:
java.io.IOException

getDataSourceInfo

public java.lang.Object getDataSourceInfo(ID dsID,
                                          java.lang.String info)
Lookup DataSource info


getProbeInfo

public java.lang.Object getProbeInfo(ID probeID,
                                     java.lang.String info)
Lookup probe details.


getProbeAttributeInfo

public java.lang.Object getProbeAttributeInfo(ID probeID,
                                              int field,
                                              java.lang.String info)
Lookup probe attribute details.


putDHT

public boolean putDHT(java.lang.String aKey,
                      java.io.Serializable aValue)
Put stuff into DHT.


getDHT

public java.lang.Object getDHT(java.lang.String aKey)
Lookup info directly from the DHT.

Returns:
the value if found, null otherwise

remDHT

public boolean remDHT(java.lang.String aKey)
Remove info from the DHT.

Returns:
boolean


RESERVOIR Monitoring 0.6.4