java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.startup.LoadRouterInfoJob
- All Implemented Interfaces:
Job
Run once or twice at startup by StartupJob, and then runs BootCommSystemJob.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classKey data container for router information.Field Summary
Constructor Summary
ConstructorsConstructorDescriptionOpens the job's log and initializes the ban logger.Method Summary
Modifier and TypeMethodDescriptiongetName()Name of this job.static LoadRouterInfoJob.KeyDatareadKeyData(File rkf1, File rkf2) Read key data from the specified files.voidrunJob()Load the local RouterInfo, rebuilding it if the files are missing.Methods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Constructor Details
LoadRouterInfoJob
Opens the job's log and initializes the ban logger.- Parameters:
ctx- the router context supplying the log and the ban logger
Method Details
getName
Name of this job.- Returns:
- the name this job is listed under in the job queue and the logs, "Load Local RouterInfo"
runJob
public void runJob()Load the local RouterInfo, rebuilding it if the files are missing.readKeyData
public static LoadRouterInfoJob.KeyData readKeyData(File rkf1, File rkf2) throws DataFormatException, IOException Read key data from the specified files.- Parameters:
rkf1- inrouter.keysformat, tried secondrkf2- in eepPriv.dat format, tried first- Returns:
- non-null, throws IOE if neither exists
- Throws:
DataFormatException- if the stored key pairs do not validate against each otherIOException- if a key file exists but cannot be opened or read