Package net.i2p.router.sybil
Class PersistSybil
- java.lang.Object
-
- net.i2p.router.sybil.PersistSybil
-
public class PersistSybil extends Object
Store and retrieve analysis files from disk. Each file is named with a timestamp.- Since:
- 0.9.38
-
-
Constructor Summary
Constructors Constructor Description PersistSybil(I2PAppContext ctx)
access via Analysis.getPersister()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(long date)
Delete the file for a particular dateList<Long>
load()
The list of stored analysis sets, as a time stamp.Map<Hash,Points>
load(long date)
Load the analysis for a certain date.Map<Long,Points>
load(Hash h)
Load all the analysis for a certain hash.void
store(long date, Map<Hash,Points> entries)
Store each entry.
-
-
-
Constructor Detail
-
PersistSybil
PersistSybil(I2PAppContext ctx)
access via Analysis.getPersister()
-
-
Method Detail
-
store
public void store(long date, Map<Hash,Points> entries) throws IOException
Store each entry.- Parameters:
entries
- each one should be "entry" at the root- Throws:
IOException
-
load
public List<Long> load()
The list of stored analysis sets, as a time stamp.- Returns:
- non-null, sorted by updated date, newest first
-
load
public Map<Hash,Points> load(long date) throws IOException
Load the analysis for a certain date.- Returns:
- non-null, unsorted
- Throws:
IOException
-
load
public Map<Long,Points> load(Hash h) throws IOException
Load all the analysis for a certain hash.- Returns:
- non-null, unsorted
- Throws:
IOException
-
delete
public boolean delete(long date)
Delete the file for a particular date- Returns:
- success
-
-