| Package | Description |
|---|---|
| de.cgrotz.kademlia | |
| de.cgrotz.kademlia.client | |
| de.cgrotz.kademlia.node | |
| de.cgrotz.kademlia.protocol | |
| de.cgrotz.kademlia.routing | |
| de.cgrotz.kademlia.storage |
| Modifier and Type | Method and Description |
|---|---|
String |
Kademlia.get(Key key)
Retrieve the Value associated with the Key
|
void |
Kademlia.get(Key key,
java.util.function.Consumer<ValueReply> valueReplyConsumer) |
void |
Kademlia.put(Key key,
String value)
Put or Update the value in the DHT
|
| Constructor and Description |
|---|
Kademlia(Key nodeId) |
Kademlia(Key nodeId,
String listeners) |
Kademlia(Key nodeId,
String listeners,
LocalStorage localStorage) |
| Modifier and Type | Method and Description |
|---|---|
void |
KademliaClient.sendContentToNode(Node node,
Key key,
String value) |
void |
KademliaClient.sendFindNode(Node node,
Key key,
java.util.function.Consumer<List<Node>> callback) |
void |
KademliaClient.sendFindValue(Node node,
Key key,
java.util.function.Consumer<NodeReply> nodeReplyConsumer,
java.util.function.Consumer<ValueReply> valueReplyConsumer) |
| Modifier and Type | Method and Description |
|---|---|
static Key |
Key.build(String key) |
Key |
Key.generateNodeIdByDistance(int distance)
Generates a Key that is some distance away from this Key
|
static Key |
Key.random() |
Key |
Key.xor(Key nid)
Checks the distance between this and another Key
|
| Modifier and Type | Method and Description |
|---|---|
int |
Key.getDistance(Key to)
Gets the distance from this Key to another Key
|
Key |
Key.xor(Key nid)
Checks the distance between this and another Key
|
| Constructor and Description |
|---|
FindNode(long seqId,
Node origin,
Key lookupId) |
FindValue(long seqId,
Node origin,
Key key) |
Store(long seqId,
Node origin,
Key key,
String value) |
ValueReply(long seqId,
Node origin,
Key key,
String value) |
| Modifier and Type | Method and Description |
|---|---|
List<Node> |
RoutingTable.findClosest(Key lookupId,
int numberOfRequiredNodes) |
int |
RoutingTable.getBucketId(Key nid)
Compute the bucket ID in which a given node should be placed; the bucketId is computed based on how far the node is away from the Local Node.
|
| Constructor and Description |
|---|
RoutingTable(int k,
Key localNodeId,
KademliaClient client) |
| Modifier and Type | Method and Description |
|---|---|
List<Key> |
LocalStorage.getKeysBeforeTimestamp(long timestamp) |
List<Key> |
InMemoryStorage.getKeysBeforeTimestamp(long timestamp) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
LocalStorage.contains(Key key) |
boolean |
InMemoryStorage.contains(Key key) |
Value |
LocalStorage.get(Key key) |
Value |
InMemoryStorage.get(Key key) |
void |
LocalStorage.put(Key key,
Value value) |
void |
InMemoryStorage.put(Key key,
Value value) |
default void |
LocalStorage.updateLastPublished(Key key,
long timestamp) |
Copyright © 2016. All Rights Reserved.