- Lots of fixes for notifying when updates and checks are complete

- Fixes for NewsHelper stored timestamps
- Add getProperty(String, long) to context for sanity
- New methods and types
- Logging improvements
- Add failsafe TaskCleaner
This commit is contained in:
zzz
2012-10-18 14:28:14 +00:00
parent 2b50c5aaf4
commit 0b4401e64b
13 changed files with 145 additions and 76 deletions

View File

@ -8,11 +8,15 @@ import java.util.List;
import net.i2p.router.RouterContext;
import net.i2p.router.web.ConfigUpdateHelper;
import net.i2p.update.*;
import static net.i2p.update.UpdateType.*;
import static net.i2p.update.UpdateMethod.*;
/**
* 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
*
* @since 0.9.4 moved from NewsFetcher
*/
class NewsHandler extends UpdateHandler implements Checker {
@ -31,8 +35,8 @@ class NewsHandler extends UpdateHandler implements Checker {
*/
public UpdateTask check(UpdateType type, UpdateMethod method,
String id, String currentVersion, long maxTime) {
if ((type != UpdateType.ROUTER_SIGNED && type != UpdateType.ROUTER_SIGNED_PACK200 && type != UpdateType.NEWS) ||
method != UpdateMethod.HTTP)
if ((type != ROUTER_SIGNED && type != ROUTER_SIGNED_PACK200 && type != NEWS) ||
method != HTTP)
return null;
List<URI> updateSources = new ArrayList(2);
try {