java.lang.Object
org.klomp.snark.dht.PersistDHT
Retrieve / Store the local DHT in a file.
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.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longOn a routine save, entries older than this (one hour in ms) are dropped; a full save keeps everything.Constructor Summary
ConstructorsConstructorDescriptionConstructor for subclasses; the load and save helpers in this base class are static.Method Summary
All MethodsModifier and TypeMethodDescriptionstatic voidLoad the DHT from a single file.static voidLoad the DHT from file, trying the backup if the primary doesn't exist.static voidSave the DHT to a file.
Field Details
MAX_AGE
private static final long MAX_AGEOn a routine save, entries older than this (one hour in ms) are dropped; a full save keeps everything.- See Also:
Constructor Details
PersistDHT
PersistDHT()Constructor for subclasses; the load and save helpers in this base class are static.
Method Details
loadDHT
loadDHT
saveDHT