|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.web.UpdateHandler
public class UpdateHandler
Handles the request to update the router by firing one or more
EepGet
calls to download the latest signed update file
and displaying the status to anyone who asks.
After the download completes the signed update file is verified with
TrustedUpdate
, and if it's authentic the payload
of the signed update file is unpacked and the router is restarted to complete
the update process.
Nested Class Summary | |
---|---|
class |
UpdateHandler.UpdateRunner
|
Field Summary | |
---|---|
protected RouterContext |
_context
|
protected Log |
_log
|
protected String |
_updateFile
|
protected static UpdateHandler.UpdateRunner |
_updateRunner
|
protected static String |
PROP_LAST_UPDATE_TIME
|
(package private) static String |
PROP_UPDATE_IN_PROGRESS
|
protected static String |
SIGNED_UPDATE_FILE
|
Constructor Summary | |
---|---|
UpdateHandler()
|
|
UpdateHandler(RouterContext ctx)
|
Method Summary | |
---|---|
protected String |
_(String s)
translate a string |
protected String |
_(String s,
Object o)
translate a string with a parameter This is a lot more expensive than _(s), so use sparingly. |
static String |
getStatus()
|
boolean |
isDone()
|
protected static String |
linkify(String url)
|
protected void |
restart()
|
void |
setContextId(String contextId)
Configure this bean to query a particular router context |
void |
setUpdateAction(String val)
these two can be set in either order, so call checkUpdateAction() twice |
void |
setUpdateNonce(String nonce)
|
void |
update()
|
protected void |
updateStatus(String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static UpdateHandler.UpdateRunner _updateRunner
protected RouterContext _context
protected Log _log
protected String _updateFile
protected static final String SIGNED_UPDATE_FILE
static final String PROP_UPDATE_IN_PROGRESS
protected static final String PROP_LAST_UPDATE_TIME
Constructor Detail |
---|
public UpdateHandler()
public UpdateHandler(RouterContext ctx)
Method Detail |
---|
public void setContextId(String contextId)
contextId
- beginning few characters of the routerHash, or null to pick
the first one we come across.public void setUpdateAction(String val)
public void setUpdateNonce(String nonce)
public void update()
public static String getStatus()
public boolean isDone()
protected void restart()
protected void updateStatus(String s)
protected static String linkify(String url)
protected String _(String s)
protected String _(String s, Object o)
s
- string to be translated containing {0}
The {0} will be replaced by the parameter.
Single quotes must be doubled, i.e. ' -> '' in the string.o
- parameter, not translated.
To tranlslate parameter also, use _("foo {0} bar", _("baz"))
Do not double the single quotes in the parameter.
Use autoboxing to call with ints, longs, floats, etc.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |