From e067761947ae22a47280ce81a08abd98698196dc Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 9 Jun 2015 03:57:44 +0000 Subject: [PATCH] Added a new flavour of checkAvailable() to UpdateManager interface. --- .../router/update/ConsoleUpdateManager.java | 26 ++++++++++++++++++- .../src/net/i2p/update/UpdateManager.java | 10 +++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java b/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java index ea153725c..93b0157e0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java +++ b/apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java @@ -275,7 +275,29 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { public String getStatus() { return _status; } - + + /** + * Is an update available? + * Blocking. + * An available update may still have a constraint or lack sources. + * @param type the UpdateType of this request + * @param id id of this request + * @param maxWait max time to block + * @return new version or null if nothing newer is available + * @since 0.9.21 + */ + public String checkAvailable(UpdateType type) { + return checkAvailable(type, "", DEFAULT_CHECK_TIME); + } + + /** + * Is an update available? + * Blocking. + * An available update may still have a constraint or lack sources. + * @param type the UpdateType of this request + * @param maxWait max time to block + * @return new version or null if nothing newer is available + */ public String checkAvailable(UpdateType type, long maxWait) { return checkAvailable(type, "", maxWait); } @@ -284,6 +306,8 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp { * Is an update available? * Blocking. * An available update may still have a constraint or lack sources. + * @param type the UpdateType of this request + * @param id id of this request * @param maxWait max time to block * @return new version or null if nothing newer is available */ diff --git a/core/java/src/net/i2p/update/UpdateManager.java b/core/java/src/net/i2p/update/UpdateManager.java index 88d116743..0cc3c79e4 100644 --- a/core/java/src/net/i2p/update/UpdateManager.java +++ b/core/java/src/net/i2p/update/UpdateManager.java @@ -122,6 +122,16 @@ public interface UpdateManager { */ public boolean notifyComplete(UpdateTask task, String actualVersion, File file); + /** + * Is an update available? + * Blocking. + * An available update may still have a constraint or lack sources. + * @param type the UpdateType of this request + * @return new version or null if nothing newer is available + * @since 0.9.21 + */ + public String checkAvailable(UpdateType type); + /** * Is an update available? * Blocking.