eu.reservoir.monitoring.im.dht
Class DistributedHashTable

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

public class DistributedHashTable
extends java.lang.Object

A Distributed Hash Table implementation. Values can be accessed and added from any one of the distributed nodes.


Constructor Summary
DistributedHashTable(int port)
          Constructor a Distributed Hash Table on a specified port
 
Method Summary
 void close()
          Close the kademlia connection.
 void connect(java.lang.String remAddress, int remPort)
          Set up kademlia to connect to a known and existing Kademlia
 boolean contains(java.lang.String aKey)
          Does the DHT contain a particular Identifier.
 java.lang.Object get(java.math.BigInteger aKey)
          Get an object out of the DHT.
 java.lang.Object get(java.lang.String aKey)
          Get an object out of the DHT.
 DistributedHashTable put(java.math.BigInteger aKey, java.io.Serializable aValue)
          Put an object into the DHT.
 DistributedHashTable put(java.lang.String aKey, java.io.Serializable aValue)
          Put an object into the DHT.
 DistributedHashTable remove(java.math.BigInteger aKey)
          Removes the mapping with the specified key.
 DistributedHashTable remove(java.lang.String aKey)
          Removes the mapping with the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedHashTable

public DistributedHashTable(int port)
                     throws java.io.IOException
Constructor a Distributed Hash Table on a specified port

Throws:
java.io.IOException
Method Detail

connect

public void connect(java.lang.String remAddress,
                    int remPort)
             throws java.io.IOException
Set up kademlia to connect to a known and existing Kademlia

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the kademlia connection.

Throws:
java.io.IOException

get

public java.lang.Object get(java.lang.String aKey)
                     throws java.io.IOException
Get an object out of the DHT.

Throws:
java.io.IOException

get

public java.lang.Object get(java.math.BigInteger aKey)
                     throws java.io.IOException
Get an object out of the DHT.

Throws:
java.io.IOException

put

public DistributedHashTable put(java.lang.String aKey,
                                java.io.Serializable aValue)
                         throws java.io.IOException
Put an object into the DHT.

Throws:
java.io.IOException

put

public DistributedHashTable put(java.math.BigInteger aKey,
                                java.io.Serializable aValue)
                         throws java.io.IOException
Put an object into the DHT.

Throws:
java.io.IOException

contains

public boolean contains(java.lang.String aKey)
                 throws java.io.IOException
Does the DHT contain a particular Identifier. Returns true if the map contains the specified key and false otherwise.

Throws:
java.io.IOException

remove

public DistributedHashTable remove(java.lang.String aKey)
                            throws java.io.IOException
Removes the mapping with the specified key.

Throws:
java.io.IOException

remove

public DistributedHashTable remove(java.math.BigInteger aKey)
                            throws java.io.IOException
Removes the mapping with the specified key.

Throws:
java.io.IOException


RESERVOIR Monitoring 0.6.4