abstract class PersistDHT extends Object
Provides static methods to load and save the DHT routing table to persistent storage. The DHT node list is stored in a simple text format with one node per line.
| Constructor and Description |
|---|
PersistDHT() |
| Modifier and Type | Method and Description |
|---|---|
static void | loadDHT(KRPC krpc,
File file)Load the DHT from a single file. |
static void | loadDHT(KRPC krpc,
File file,
File backupFile)Load the DHT from file, trying the backup if the primary doesn't exist. |
static void | saveDHT(DHTNodes nodes,
boolean saveAll,
File file)Save the DHT to a file. |
public static void loadDHT(KRPC krpc, File file)
krpc - the KRPC instance to load nodes intofile - the DHT file to loadpublic static void loadDHT(KRPC krpc, File file, File backupFile)
krpc - the KRPC instance to load nodes intofile - the primary DHT filebackupFile - may be null