java.lang.Object
net.i2p.router.networkdb.reseed.ReseedBundler
Copy a random selection of 'count' router infos from configDir/netDb to 'toDir'. Skip your own router info, and old, hidden, unreachable, and introduced routers, and those from bad countries.
Much easier than the one in installer/tools since we have a running router.
Caller must delete file when done.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router building the bundle.private static final StringOldest router version included in a bundle.private static final intFewest routers that make a bundle worth reseeding with.private static final StringStart of a router info file's name.private static final StringEnd of a router info file's name.Constructor Summary
ConstructorsConstructorDescriptionHolds the router context used for netDb lookups and temp file access.Method Summary
Modifier and TypeMethodDescriptioncreateZip(int count) Create a zip file with a random selection of 'count' router infos from configDir/netDb to 'toDir'.private static StringgetRouterInfoName(Hash hash) Copied/modded from PersistentDataStore.
Field Details
_context
The router building the bundle.ROUTERINFO_PREFIX
Start of a router info file's name.- See Also:
ROUTERINFO_SUFFIX
End of a router info file's name.- See Also:
MINIMUM
private static final int MINIMUMFewest routers that make a bundle worth reseeding with.- See Also:
MIN_VERSION
Oldest router version included in a bundle.- See Also:
Constructor Details
ReseedBundler
Holds the router context used for netDb lookups and temp file access.- Parameters:
ctx- the router context used to reach netDb, commSystem, and the temp directory
Method Details
createZip
Create a zip file with a random selection of 'count' router infos from configDir/netDb to 'toDir'. Skip your own router info, and old, hidden, unreachable, and introduced routers, and those from bad countries.The file will be in the temp directory. Caller must move or delete.
- Parameters:
count- how many router infos to bundle; at least MINIMUM are required unless fewer qualify- Returns:
- the freshly written zip in the router temp directory, which the caller must move or delete
- Throws:
IOException- if no eligible router infos were found, if fewer than the requested count qualified, or if the temp file could not be written
getRouterInfoName