ClientApp
, RouterApp
, UpdateManager
public class ConsoleUpdateManager extends java.lang.Object implements UpdateManager, RouterApp
APP_NAME
コンストラクタ | 説明 |
---|---|
ConsoleUpdateManager(RouterContext ctx,
ClientAppManager listener,
java.lang.String[] args) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
java.lang.String |
_t(java.lang.String s) |
translate a string
|
java.lang.String |
_t(java.lang.String s,
java.lang.Object o) |
translate a string with a parameter
|
java.lang.String |
_t(java.lang.String s,
java.lang.Object o,
java.lang.Object o2) |
translate a string with parameters
|
void |
check(UpdateType type) |
Fire off a checker task
Non-blocking.
|
void |
check(UpdateType type,
java.lang.String id) |
Fire off a checker task
Non-blocking.
|
java.lang.String |
checkAvailable(UpdateType type) |
Is an update available?
Blocking.
|
java.lang.String |
checkAvailable(UpdateType type,
long maxWait) |
Is an update available?
Blocking.
|
java.lang.String |
checkAvailable(UpdateType type,
java.lang.String id,
long maxWait) |
Is an update available?
Blocking.
|
java.lang.String |
getDisplayName() |
The display name of the ClientApp, used in user interfaces.
|
static ConsoleUpdateManager |
getInstance() |
|
java.lang.String |
getName() |
The generic name of the ClientApp, used for registration,
e.g.
|
ClientAppState |
getState() |
The current state of the ClientApp.
|
java.lang.String |
getStatus() |
The status on any update current or last finished.
|
java.lang.String |
getUpdateAvailable(UpdateType type) |
Is an update available?
Non-blocking, returns result of last check or notification from an Updater.
|
java.lang.String |
getUpdateAvailable(UpdateType type,
java.lang.String id) |
Is an update available?
Non-blocking, returns result of last check or notification from an Updater.
|
java.lang.String |
getUpdateConstraint(UpdateType type,
java.lang.String id) |
Is there a reason we can't download the update?
|
java.lang.String |
getUpdateDownloaded(UpdateType type) |
Is an update downloaded?
Non-blocking, returns result of last download
|
java.lang.String |
getUpdateDownloaded(UpdateType type,
java.lang.String id) |
Is an update downloaded?
Non-blocking, returns result of last download
|
java.util.List<java.net.URI> |
getUpdateURLs(UpdateType type,
java.lang.String id,
UpdateMethod method) |
Where to find various resources
|
boolean |
installPlugin(java.lang.String name,
java.net.URI uri) |
Install a plugin.
|
boolean |
isCheckInProgress() |
Is any check in progress?
Does not include updates.
|
boolean |
isCheckInProgress(UpdateType type) |
Is a check in progress?
|
boolean |
isCheckInProgress(UpdateType type,
java.lang.String id) |
Is a check in progress?
|
boolean |
isUpdateInProgress() |
Is any download in progress?
Does not include checks.
|
boolean |
isUpdateInProgress(UpdateType type) |
Is a download in progress?
|
boolean |
isUpdateInProgress(UpdateType type,
java.lang.String id) |
Is a download in progress?
|
(package private) static java.lang.String |
linkify(java.lang.String url) |
|
void |
notifyAttemptFailed(UpdateTask task,
java.lang.String reason,
java.lang.Throwable t) |
Not necessarily the end if there are more URIs to try.
|
void |
notifyCheckComplete(UpdateTask task,
boolean newer,
boolean success) |
Called by the Updater after check() was called and all notifyVersionAvailable() callbacks are finished
|
void |
notifyComplete(UpdateTask task,
java.lang.String status) |
An expiring status
|
boolean |
notifyComplete(UpdateTask task,
java.lang.String actualVersion,
java.io.File file) |
An update has been downloaded but not verified.
|
void |
notifyProgress(UpdateTask task,
java.lang.String status) |
|
void |
notifyProgress(UpdateTask task,
java.lang.String status,
long downloaded,
long totalSize) |
|
void |
notifyTaskFailed(UpdateTask task,
java.lang.String reason,
java.lang.Throwable t) |
The task has finished and failed.
|
boolean |
notifyVersionAvailable(UpdateTask task,
java.net.URI newsSource,
UpdateType type,
java.lang.String id,
java.util.Map<UpdateMethod,java.util.List<java.net.URI>> sourceMap,
java.lang.String newVersion,
java.lang.String minVersion) |
Called by the Checker, either after check() was called, or it found out on its own.
|
boolean |
notifyVersionAvailable(UpdateTask task,
java.net.URI newsSource,
UpdateType type,
java.lang.String id,
UpdateMethod method,
java.util.List<java.net.URI> updateSources,
java.lang.String newVersion,
java.lang.String minVersion) |
Called by the Updater, either after check() was called, or it found out on its own.
|
void |
notifyVersionConstraint(UpdateTask task,
java.net.URI newsSource,
UpdateType type,
java.lang.String id,
java.lang.String newVersion,
java.lang.String message) |
A new version is available but cannot be downloaded or installed due to some constraint.
|
void |
register(Checker updater,
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(java.io.Writer out) |
debug
|
(package private) boolean |
shouldInstall() |
from NewsFetcher
|
void |
shutdown() |
UpdateManager interface
|
void |
shutdown(java.lang.String[] args) |
ClientApp interface
|
void |
start() |
UpdateManager interface
|
void |
startup() |
ClientApp interface
|
void |
stopCheck(UpdateType type) |
Stop this check
|
void |
stopCheck(UpdateType type,
java.lang.String id) |
Stop this check
|
void |
stopChecks() |
Stop all checks in progress
|
void |
stopUpdate(UpdateType type) |
Stop this download
|
void |
stopUpdate(UpdateType type,
java.lang.String id) |
Stop this download
|
void |
stopUpdates() |
Stop all downloads in progress
|
void |
unregister(Checker updater,
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,
java.lang.String id) |
Non-blocking.
|
boolean |
update(UpdateType type,
java.lang.String id,
long maxTime) |
Non-blocking.
|
public ConsoleUpdateManager(RouterContext ctx, ClientAppManager listener, java.lang.String[] args)
args
- ignoredpublic static ConsoleUpdateManager getInstance()
public void start()
start
インタフェース内 UpdateManager
public void startup()
public void shutdown()
shutdown
インタフェース内 UpdateManager
public void shutdown(java.lang.String[] args)
public ClientAppState getState()
ClientApp
public java.lang.String getName()
ClientApp
public java.lang.String getDisplayName()
ClientApp
getDisplayName
インタフェース内 ClientApp
public java.lang.String getStatus()
getStatus
インタフェース内 UpdateManager
public java.lang.String checkAvailable(UpdateType type)
checkAvailable
インタフェース内 UpdateManager
type
- the UpdateType of this requestpublic java.lang.String checkAvailable(UpdateType type, long maxWait)
checkAvailable
インタフェース内 UpdateManager
type
- the UpdateType of this requestmaxWait
- max time to blockpublic java.lang.String checkAvailable(UpdateType type, java.lang.String id, long maxWait)
checkAvailable
インタフェース内 UpdateManager
type
- the UpdateType of this requestid
- id of this requestmaxWait
- max time to blockpublic void check(UpdateType type)
public void check(UpdateType type, java.lang.String id)
public java.lang.String getUpdateAvailable(UpdateType type)
public java.lang.String getUpdateAvailable(UpdateType type, java.lang.String id)
public java.lang.String getUpdateDownloaded(UpdateType type)
public java.lang.String getUpdateDownloaded(UpdateType type, java.lang.String id)
public boolean isUpdateInProgress()
isUpdateInProgress
インタフェース内 UpdateManager
public boolean isUpdateInProgress(UpdateType type)
isUpdateInProgress
インタフェース内 UpdateManager
type
- the UpdateType of this requestpublic boolean isUpdateInProgress(UpdateType type, java.lang.String id)
isUpdateInProgress
インタフェース内 UpdateManager
type
- the UpdateType of this requestid
- of this requestpublic void stopUpdates()
public void stopUpdate(UpdateType type)
public void stopUpdate(UpdateType type, java.lang.String id)
public boolean isCheckInProgress()
public boolean isCheckInProgress(UpdateType type)
public boolean isCheckInProgress(UpdateType type, java.lang.String id)
public void stopChecks()
public void stopCheck(UpdateType type)
public void stopCheck(UpdateType type, java.lang.String id)
public boolean installPlugin(java.lang.String name, java.net.URI uri)
name
- if null, a new installpublic boolean update(UpdateType type)
update
インタフェース内 UpdateManager
type
- the UpdateType of this requestpublic boolean update(UpdateType type, java.lang.String id)
update
インタフェース内 UpdateManager
type
- the UpdateType of this requestid
- id of this requestpublic boolean update(UpdateType type, long maxTime)
update
インタフェース内 UpdateManager
maxTime
- not honored by all Updaterstype
- the UpdateType of this requestpublic boolean update(UpdateType type, java.lang.String id, long maxTime)
update
インタフェース内 UpdateManager
maxTime
- not honored by all Updaterstype
- the UpdateType of this requestid
- id of this requestpublic void register(Updater updater, UpdateType type, UpdateMethod method, int priority)
register
インタフェース内 UpdateManager
public void unregister(Updater updater, UpdateType type, UpdateMethod method)
unregister
インタフェース内 UpdateManager
public void register(Checker updater, UpdateType type, UpdateMethod method, int priority)
register
インタフェース内 UpdateManager
public void unregister(Checker updater, UpdateType type, UpdateMethod method)
unregister
インタフェース内 UpdateManager
public boolean notifyVersionAvailable(UpdateTask task, java.net.URI newsSource, UpdateType type, java.lang.String id, UpdateMethod method, java.util.List<java.net.URI> updateSources, java.lang.String newVersion, java.lang.String minVersion)
notifyVersionAvailable
インタフェース内 UpdateManager
newsSource
- who told usid
- plugin name for plugins, ignored otherwiseupdateSources
- Where to get the new versionnewVersion
- The new version availableminVersion
- The minimum installed version to be able to update to newVersionmethod
- How to get the new versionpublic boolean notifyVersionAvailable(UpdateTask task, java.net.URI newsSource, UpdateType type, java.lang.String id, java.util.Map<UpdateMethod,java.util.List<java.net.URI>> sourceMap, java.lang.String newVersion, java.lang.String minVersion)
notifyVersionAvailable
インタフェース内 UpdateManager
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 newVersionpublic void notifyVersionConstraint(UpdateTask task, java.net.URI newsSource, UpdateType type, java.lang.String id, java.lang.String newVersion, java.lang.String message)
notifyVersionConstraint
インタフェース内 UpdateManager
newsSource
- who told usid
- plugin name for plugins, ignored otherwisenewVersion
- The new version availablemessage
- A translated message to be displayed to the user, non-nullpublic void notifyCheckComplete(UpdateTask task, boolean newer, boolean success)
notifyCheckComplete
インタフェース内 UpdateManager
newer
- notifyVersionAvailable was calledsuccess
- check succeeded (newer or not)public void notifyProgress(UpdateTask task, java.lang.String status, long downloaded, long totalSize)
notifyProgress
インタフェース内 UpdateManager
public void notifyProgress(UpdateTask task, java.lang.String status)
notifyProgress
インタフェース内 UpdateManager
task
- may be nullpublic void notifyComplete(UpdateTask task, java.lang.String status)
task
- may be nullpublic void notifyAttemptFailed(UpdateTask task, java.lang.String reason, java.lang.Throwable t)
notifyAttemptFailed
インタフェース内 UpdateManager
task
- checker or updatert
- may be nullpublic void notifyTaskFailed(UpdateTask task, java.lang.String reason, java.lang.Throwable t)
notifyTaskFailed
インタフェース内 UpdateManager
task
- checker or updatert
- may be nullpublic boolean notifyComplete(UpdateTask task, java.lang.String actualVersion, java.io.File file)
notifyComplete
インタフェース内 UpdateManager
task
- must be an Updater, not a CheckeractualVersion
- may be higher (or lower?) than the version requestedfile
- a valid format for the task's UpdateType, or null if it did the installation itselfboolean shouldInstall()
public java.util.List<java.net.URI> getUpdateURLs(UpdateType type, java.lang.String id, UpdateMethod method)
public java.lang.String getUpdateConstraint(UpdateType type, java.lang.String id)
static java.lang.String linkify(java.lang.String url)
public java.lang.String _t(java.lang.String s)
public java.lang.String _t(java.lang.String s, java.lang.Object o)
public java.lang.String _t(java.lang.String s, java.lang.Object o, java.lang.Object o2)
public void renderStatusHTML(java.io.Writer out) throws java.io.IOException
renderStatusHTML
インタフェース内 UpdateManager
java.io.IOException