public interface UpdateManager| Modifier and Type | Field and Description |
|---|---|
static String | APP_NAMEThe name we register with the ClientAppManager |
| Modifier and Type | Method and Description |
|---|---|
String | checkAvailable(UpdateType type)Is an update available?
Blocking. |
String | checkAvailable(UpdateType type,
long maxWait)Is an update available?
Blocking. |
String | checkAvailable(UpdateType type,
String id,
long maxWait)Is an update available?
Blocking. |
String | getStatus()The status on any update current or last finished. |
boolean | isUpdateInProgress()Is a router update being downloaded? |
boolean | isUpdateInProgress(UpdateType type)Is a router update being downloaded? |
boolean | isUpdateInProgress(UpdateType type,
String id)Is a router update being downloaded? |
void | notifyAttemptFailed(UpdateTask task,
String reason,
Throwable t)Not necessarily the end if there are more URIs to try. |
void | notifyCheckComplete(UpdateTask task,
boolean newer,
boolean success)Called by the Checker after check() was called and all notifyVersionAvailable() callbacks are finished |
boolean | notifyComplete(UpdateTask task,
String actualVersion,
File file)An update has been downloaded but not verified. |
void | notifyInstalled(UpdateType type,
String id,
String version)Tell the UpdateManager that a version is already installed. |
void | notifyProgress(UpdateTask task,
String status)Notify of progress update. |
void | notifyProgress(UpdateTask task,
String status,
long downloaded,
long totalSize)Notify of progress update with size information. |
void | notifyTaskFailed(UpdateTask task,
String reason,
Throwable t)The task has finished and failed. |
boolean | notifyVersionAvailable(UpdateTask task,
URI newsSource,
UpdateType type,
String id,
Map<UpdateMethod,List<URI>> sourceMap,
String newVersion,
String minVersion)Called by the Checker, either after check() was called, or it found out on its own. |
boolean | notifyVersionAvailable(UpdateTask task,
URI newsSource,
UpdateType type,
String id,
UpdateMethod method,
List<URI> updateSources,
String newVersion,
String minVersion)Called by the Checker, either after check() was called, or it found out on its own. |
void | notifyVersionConstraint(UpdateTask task,
URI newsSource,
UpdateType type,
String id,
String newVersion,
String message)A new version is available but cannot be downloaded or installed due to some constraint. |
void | register(Checker checker,
UpdateType type,
UpdateMethod method,
int priority)Register a checker for updates. |
void | register(UpdatePostProcessor upp,
UpdateType type,
int fileType)Register a post-processor for this UpdateType and SU3File file type. |
void | register(Updater updater,
UpdateType type,
UpdateMethod method,
int priority)Call once for each type/method pair. |
void | renderStatusHTML(Writer out)For debugging |
void | shutdown()Shutdown the update manager. |
void | start()Start the update manager. |
void | unregister(Checker checker,
UpdateType type,
UpdateMethod method)Unregister a checker. |
void | unregister(Updater updater,
UpdateType type,
UpdateMethod method)Unregister an updater. |
boolean | update(UpdateType type)Non-blocking. |
boolean | update(UpdateType type,
long maxTime)Non-blocking. |
boolean | update(UpdateType type,
String id)Non-blocking. |
boolean | update(UpdateType type,
String id,
long maxTime)Non-blocking. |
static final String APP_NAME
String checkAvailable(UpdateType type)
type - the UpdateType of this requestString checkAvailable(UpdateType type, long maxWait)
type - the UpdateType of this requestmaxWait - max time to blockString checkAvailable(UpdateType type, String id, long maxWait)
type - the UpdateType of this requestmaxWait - max time to blockid - id of this requestString getStatus()
boolean isUpdateInProgress()
boolean isUpdateInProgress(UpdateType type)
type - the UpdateType of this requestboolean isUpdateInProgress(UpdateType type, String id)
type - the UpdateType of this requestid - of this requestvoid notifyAttemptFailed(UpdateTask task, String reason, Throwable t)
task - update taskreason - failure reasont - may be nullvoid notifyCheckComplete(UpdateTask task, boolean newer, boolean success)
task - update tasknewer - notifyVersionAvailable was calledsuccess - check succeeded (newer or not)boolean notifyComplete(UpdateTask task, String actualVersion, File file)
task - update taskactualVersion - may be higher (or lower?) than the version requestedfile - a valid format for the task's UpdateTypevoid notifyInstalled(UpdateType type, String id, String version)
type - update typeid - subtype for plugins, or ""version - null to remove from installedvoid notifyProgress(UpdateTask task, String status)
task - update taskstatus - status messagevoid notifyProgress(UpdateTask task, String status, long downloaded, long totalSize)
task - update taskstatus - status messagedownloaded - bytes downloadedtotalSize - total sizevoid notifyTaskFailed(UpdateTask task, String reason, Throwable t)
task - update taskreason - failure reasont - may be nullboolean notifyVersionAvailable(UpdateTask task, URI newsSource, UpdateType type, String id, Map<UpdateMethod,List<URI>> sourceMap, String newVersion, String minVersion)
task - update tasknewsSource - who told ustype - update typeid - plugin name for plugins, ignored otherwisesourceMap - Mapping of methods to sourcesnewVersion - The new version availableminVersion - The minimum installed version to be able to update to newVersionboolean notifyVersionAvailable(UpdateTask task, URI newsSource, UpdateType type, String id, UpdateMethod method, List<URI> updateSources, String newVersion, String minVersion)
task - update tasknewsSource - who told ustype - update typeid - plugin name for plugins, ignored otherwisemethod - How to get the new versionupdateSources - Where to get the new versionnewVersion - The new version availableminVersion - The minimum installed version to be able to update to newVersionvoid notifyVersionConstraint(UpdateTask task, URI newsSource, UpdateType type, String id, String newVersion, String message)
task - update tasknewsSource - who told ustype - update typeid - plugin name for plugins, ignored otherwisenewVersion - The new version availablemessage - A translated message to be displayed to the user, non-nullvoid register(Checker checker, UpdateType type, UpdateMethod method, int priority)
checker - the checkertype - the update typemethod - the update methodpriority - the priorityvoid register(UpdatePostProcessor upp, UpdateType type, int fileType)
upp - update post processortype - only ROUTER_SIGNED_SU3 and ROUTER_DEV_SU3 are currently supportedfileType - a SU3File TYPE_xxx constant, 1-255, TYPE_ZIP not supported.void register(Updater updater, UpdateType type, UpdateMethod method, int priority)
updater - the updatertype - the update typemethod - the update methodpriority - the priorityvoid renderStatusHTML(Writer out) throws IOException
out - writer to output toIOException - if writing failsvoid shutdown()
void start()
void unregister(Checker checker, UpdateType type, UpdateMethod method)
checker - the checkertype - the update typemethod - the update methodvoid unregister(Updater updater, UpdateType type, UpdateMethod method)
updater - the updatertype - the update typemethod - the update methodboolean update(UpdateType type)
type - the UpdateType of this requestboolean update(UpdateType type, long maxTime)
type - the UpdateType of this requestmaxTime - not honored by all Updatersboolean update(UpdateType type, String id)
type - the UpdateType of this requestid - id of this requestboolean update(UpdateType type, String id, long maxTime)
type - the UpdateType of this requestmaxTime - not honored by all Updatersid - id of this request