java.lang.Object
net.i2p.router.update.UpdateHandler
net.i2p.router.update.NewsHandler
Task to periodically look for updates to the news.xml, and to keep track of whether that has an announcement for a new version.
Overrides UpdateRunner for convenience, this is not an Updater.
Field Summary
FieldsFields inherited from class UpdateHandler
_context, _mgrModifier and TypeFieldDescriptionprotected final RouterContextThe router context for configuration access.protected final ConsoleUpdateManagerThe update manager for coordinating updates.Constructor Summary
ConstructorsConstructorDescriptionNewsHandler(RouterContext ctx, ConsoleUpdateManager mgr) Creates the news update checker for the given update manager.Method Summary
Modifier and TypeMethodDescriptioncheck(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime) This will check for news or router updates (it does the same thing).static voidCLI fetch.private static voidtest(I2PAppContext ctx, String phost, int pport, String url, File file) CLI fetch.Methods inherited from class UpdateHandler
updateModifier and TypeMethodDescriptionupdate(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
DEFAULT_BACKUP_NEWS_URL_SU3
Fallback news feed URL for SU3 updates.- See Also:
PROP_BACKUP_NEWS_URL_SU3
Property overriding the fallback news feed URL- See Also:
Constructor Details
NewsHandler
Creates the news update checker for the given update manager.- Parameters:
ctx- the router context for the news fetchermgr- the update manager that runs the fetched update tasks
Method Details
check
public UpdateTask check(UpdateType type, UpdateMethod method, String id, String currentVersion, long maxTime) This will check for news or router updates (it does the same thing). Should not block.- 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, stored locallymaxTime- how long you have- Returns:
- active task or null if unable to check
main
CLI fetch.- Parameters:
args- command line arguments: -p proxy port, -l language, -u override news URL
test
CLI fetch.- Parameters:
ctx- the context for the HTTP clientphost- the proxy host, or null for no proxypport- the proxy port, ignored without a proxyurl- the news SU3 URL to fetchfile- the local file to write the download to