java.lang.Object
net.i2p.router.update.DevSU3UpdateHandler
Handles the request to update the router by firing off an EepGet call to download the latest su3 file and display the status.
After the download completes the su3 is verified, and the zip is extracted and copied to the router directory, and if configured the router is restarted to complete the update process.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router context the handler runs in.private final ConsoleUpdateManagerThe manager that installs the update.Constructor Summary
ConstructorsConstructorDescriptionDevSU3UpdateHandler.Method Summary
All MethodsModifier and TypeMethodDescriptioncheck(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime) Look for a dev SU3 update.Returns the dev SU3 download location as a single-element list.update(UpdateType type, UpdateMethod method, List<URI> updateSources, String id, String newVersion, long maxTime) Start a download and return a handle to the download task.
Field Details
_context
The router context the handler runs in._mgr
The manager that installs the update.
Constructor Details
DevSU3UpdateHandler
DevSU3UpdateHandler.- Parameters:
ctx- the router context supplying the dev SU3 URL property and the logmgr- the update manager that runs the checker and reports its progress
Method Details
getUpdateSources
Returns the dev SU3 download location as a single-element list. The URL comes from the console property set by the user, so it is null when that property is unset and also when its value does not parse as a URI, leaving the checker with nothing to fetch.- Returns:
- null if none
check
public UpdateTask check(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime) Look for a dev SU3 update.- Specified by:
checkin interfaceChecker- Parameters:
type- the kind of update to look for, e.g.UpdateType.ROUTER_SIGNEDmethod- the transport to fetch it over, e.g.UpdateMethod.HTTPid- plugin name or ignoredcurrentVersion- ignored, we use current router versionmaxTime- how long you have- Returns:
- active task or null if unable to check
update
public UpdateTask update(UpdateType type, UpdateMethod method, List<URI> updateSources, String id, String newVersion, long maxTime) Start a download and return a handle to the download task. Should not block.- Specified by:
updatein interfaceUpdater- Parameters:
type- selects what is being fetched, e.g.UpdateType.ROUTER_SIGNEDmethod- how it is fetched, e.g.UpdateMethod.HTTPover I2PupdateSources- Where to get the new version fromid- plugin name or ignorednewVersion- new version to downloadmaxTime- how long you have- Returns:
- active task or null if unable to download