public class PersistSybil extends Object
| Constructor and Description |
|---|
PersistSybil(I2PAppContext ctx)Create a new PersistSybil instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean | delete(long date)Delete the file for a particular date |
void | deleteBlocklistFile()Delete the blocklist |
File | getBlocklistFile()Get the blocklist path |
List<Long> | load()The list of stored analysis sets, as a time stamp. |
Map<Long,Points> | load(Hash h)Load all the analysis for a certain hash. |
Map<Hash,Points> | load(long date)Load the analysis for a certain date. |
(package private) Map<String,Long> | readBlocklist()Read the blocklist |
void | removeOld()Remove all files older than configured threshold
Inline for now, thread later if necessary |
void | store(long date,
Map<Hash,Points> entries)Store each entry. |
(package private) void | storeBlocklist(Set<String> blocks,
long blockUntil)Write the blocklist. |
public PersistSybil(I2PAppContext ctx)
ctx - the router contextpublic boolean delete(long date)
date - the timestamp for the filepublic void deleteBlocklistFile()
public File getBlocklistFile()
public List<Long> load()
public Map<Long,Points> load(Hash h) throws IOException
h - the hash to loadIOException - if an I/O error occurspublic Map<Hash,Points> load(long date) throws IOException
date - the timestamp for the fileIOException - if an I/O error occursMap<String,Long> readBlocklist()
public void removeOld()
public void store(long date,
Map<Hash,Points> entries)
throws IOExceptiondate - the timestamp for the fileentries - each one should be "entry" at the rootIOException - if an I/O error occursvoid storeBlocklist(Set<String> blocks, long blockUntil)
blocks - non-empty, will be merged with existing entriesblockUntil - the expiration time in ms