Package net.i2p.router.sybil
Class PersistSybil
java.lang.Object
net.i2p.router.sybil.PersistSybil
Store and retrieve analysis files from disk.
Each file is named with a timestamp.
- Since:
- 0.9.38
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
delete
(long date) Delete the file for a particular dateload()
The list of stored analysis sets, as a time stamp.load
(long date) Load the analysis for a certain date.Load all the analysis for a certain hash.Read the blocklistvoid
Remove all files older than configured threshold Inline for now, thread later if necessaryvoid
Store each entry.(package private) void
storeBlocklist
(Set<String> blocks, long blockUntil) Write the blocklist.
-
Constructor Details
-
PersistSybil
PersistSybil(I2PAppContext ctx) access via Analysis.getPersister()
-
-
Method Details
-
store
Store each entry.- Parameters:
entries
- each one should be "entry" at the root- Throws:
IOException
-
load
The list of stored analysis sets, as a time stamp.- Returns:
- non-null, sorted by updated date, newest first
-
load
Load the analysis for a certain date.- Returns:
- non-null, unsorted
- Throws:
IOException
-
load
Load all the analysis for a certain hash.- Returns:
- non-null, unsorted
- Throws:
IOException
-
removeOld
public void removeOld()Remove all files older than configured threshold Inline for now, thread later if necessary- Since:
- 0.9.41
-
delete
public boolean delete(long date) Delete the file for a particular date- Returns:
- success
-
readBlocklist
Read the blocklist- Returns:
- map of ip or hash to expiration (ms), or null on failure
- Since:
- 0.9.50
-
storeBlocklist
Write the blocklist. The format is different than other blocklists because we include an expiration. Format: One per line: ip or hash,expiration time (ms)- Parameters:
blocks
- non-empty, will be merged with existing entries- Since:
- 0.9.50
-