public interface UpdateManager
Modifier and Type | Field and Description |
---|---|
static String |
APP_NAME
The 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 |
notifyProgress(UpdateTask task,
String status) |
void |
notifyProgress(UpdateTask task,
String status,
long downloaded,
long totalSize) |
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) |
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() |
void |
start() |
void |
unregister(Checker checker,
UpdateType type,
UpdateMethod method) |
void |
unregister(Updater updater,
UpdateType type,
UpdateMethod method) |
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
void register(Updater updater, UpdateType type, UpdateMethod method, int priority)
void register(Checker checker, UpdateType type, UpdateMethod method, int priority)
void unregister(Updater updater, UpdateType type, UpdateMethod method)
void unregister(Checker checker, UpdateType type, UpdateMethod method)
void start()
void shutdown()
boolean notifyVersionAvailable(UpdateTask task, URI newsSource, UpdateType type, String id, UpdateMethod method, List<URI> updateSources, String newVersion, String minVersion)
newsSource
- who told usid
- 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 newVersionboolean notifyVersionAvailable(UpdateTask task, URI newsSource, UpdateType type, String id, Map<UpdateMethod,List<URI>> sourceMap, String newVersion, String minVersion)
newsSource
- who told usid
- 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 newVersionvoid notifyVersionConstraint(UpdateTask task, URI newsSource, UpdateType type, String id, String newVersion, String message)
newsSource
- who told usid
- plugin name for plugins, ignored otherwisenewVersion
- The new version availablemessage
- A translated message to be displayed to the user, non-nullvoid notifyCheckComplete(UpdateTask task, boolean newer, boolean success)
newer
- notifyVersionAvailable was calledsuccess
- check succeeded (newer or not)void notifyProgress(UpdateTask task, String status)
void notifyProgress(UpdateTask task, String status, long downloaded, long totalSize)
void notifyAttemptFailed(UpdateTask task, String reason, Throwable t)
t
- may be nullvoid notifyTaskFailed(UpdateTask task, String reason, Throwable t)
t
- may be nullboolean notifyComplete(UpdateTask task, String actualVersion, File file)
actualVersion
- may be higher (or lower?) than the version requestedfile
- a valid format for the task's UpdateTypeString 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 requestboolean isUpdateInProgress()
boolean isUpdateInProgress(UpdateType type)
type
- the UpdateType of this requestboolean isUpdateInProgress(UpdateType type, String id)
type
- the UpdateType of this requestid
- of this requestboolean update(UpdateType type)
type
- the UpdateType of this requestboolean update(UpdateType type, String id)
type
- the UpdateType of this requestid
- id of this requestboolean update(UpdateType type, long maxTime)
type
- the UpdateType of this requestmaxTime
- not honored by all Updatersboolean update(UpdateType type, String id, long maxTime)
type
- the UpdateType of this requestmaxTime
- not honored by all Updatersid
- id of this requestString getStatus()
void renderStatusHTML(Writer out) throws IOException
IOException