Skip to content

Distributed Hash Table (DHT)

Raphael Matile edited this page Mar 17, 2016 · 2 revisions

Only some metadata is stored in the distributed hash table (DHT):

  • List of connected nodes
  • Salt of the user
  • Public Key
  • encrypted Private Key
  • File Identifiers

To access all these values stored in the DHT, each INode provides a NodeManager allowing to fetch this data:

import org.rmatil.sync.network.api.IIdentifierManager;
import org.rmatil.sync.network.api.INode;
import org.rmatil.sync.network.api.INodeManager;
import org.rmatil.sync.network.api.IUserManager;

import java.util.UUID;


// ...
// Connect resp. bootstrap the node before
// ...



  INode node = sync.getNode();
  // check whether an user is registered, login resp. logout users
  IUserManager userManager = node.getUserManager();
  // access some information stored in the distributed hash table
  INodeManager nodeManager = node.getNodeManager();
  // get file identifiers
  IIdentifierManager<String, UUID> identifierManager = node.getIdentifierManager();