2 """Some interfaces that are used by the apt-dht classes."""
4 from zope.interface import Interface
7 """An abstract interface for using a DHT implementation."""
9 def loadConfig(self, config, section):
10 """Load the DHTs configuration from a dictionary.
12 @type config: C{SafeConfigParser}
13 @param config: the dictionary of config values
17 """Bootstrap the new DHT node into the DHT.
20 @return: a deferred that will fire when the node has joined
24 """Depart gracefully from the DHT.
27 @return: a deferred that will fire when the node has left
30 def getValue(self, key):
31 """Get a value from the DHT for the specified key.
33 The length of the key may be adjusted for use with the DHT.
36 @return: a deferred that will fire with the stored values
39 def storeValue(self, key, value):
40 """Store a value in the DHT for the specified key.
42 The length of the key may be adjusted for use with the DHT.