Runnable, UpdateTask, EepGet.StatusListenerDevSU3UpdateChecker, DevSU3UpdateRunner, NewsFetcher, PluginUpdateChecker, PluginUpdateRunner, UnsignedUpdateChecker, UnsignedUpdateRunnerclass UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusListener
I2PThread.OOMEventListenerThread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field | Description |
|---|---|---|
protected ByteArrayOutputStream |
_baos |
56 byte header, only used for suds
|
protected RouterContext |
_context |
|
protected URI |
_currentURI |
|
protected EepGet |
_get |
|
protected boolean |
_isPartial |
tells the listeners what mode we are in - set to true in extending classes for checks
|
protected boolean |
_isRunning |
|
protected Log |
_log |
|
protected UpdateMethod |
_method |
|
protected ConsoleUpdateManager |
_mgr |
|
protected String |
_newVersion |
set by the listeners on completion
|
protected UpdateType |
_type |
|
protected String |
_updateFile |
|
protected List<URI> |
_urls |
|
protected static long |
CONNECT_TIMEOUT |
|
protected boolean |
done |
|
protected static long |
INACTIVITY_TIMEOUT |
|
protected static long |
NOPROXY_INACTIVITY_TIMEOUT |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor | Description |
|---|---|
UpdateRunner(RouterContext ctx,
ConsoleUpdateManager mgr,
UpdateType type,
List<URI> uris) |
Uses router version for partial checks
|
UpdateRunner(RouterContext ctx,
ConsoleUpdateManager mgr,
UpdateType type,
List<URI> uris,
String currentVersion) |
|
UpdateRunner(RouterContext ctx,
ConsoleUpdateManager mgr,
UpdateType type,
UpdateMethod method,
List<URI> uris) |
Uses router version for partial checks
|
UpdateRunner(RouterContext ctx,
ConsoleUpdateManager mgr,
UpdateType type,
UpdateMethod method,
List<URI> uris,
String currentVersion) |
| Modifier and Type | Method | Description |
|---|---|---|
protected String |
_t(String s) |
translate a string
|
protected String |
_t(String s,
Object o) |
translate a string with a parameter
|
void |
attemptFailed(String url,
long bytesTransferred,
long bytesRemaining,
int currentAttempt,
int numRetries,
Exception cause) |
|
void |
attempting(String url) |
|
void |
bytesTransferred(long alreadyTransferred,
int currentWrite,
long bytesTransferred,
long bytesRemaining,
String url) |
subclasses should override
|
String |
getID() |
Valid for plugins
|
UpdateMethod |
getMethod() |
|
UpdateType |
getType() |
|
URI |
getURI() |
The current URI being checked or downloaded from.
|
void |
headerReceived(String url,
int attemptNum,
String key,
String val) |
Note: Headers are not processed, and this is not called, for most error response codes,
unless setWriteErrorToOutput() is called before fetch().
|
boolean |
isRunning() |
|
protected static String |
linkify(String url) |
|
void |
run() |
|
void |
shutdown() |
|
String |
toString() |
|
void |
transferComplete(long alreadyTransferred,
long bytesTransferred,
long bytesRemaining,
String url,
String outputFile,
boolean notModified) |
subclasses should override
|
void |
transferFailed(String url,
long bytesTransferred,
long bytesRemaining,
int currentAttempt) |
subclasses should override
|
protected void |
update() |
Loop through the entire list of update URLs.
|
protected void |
updateStatus(String s) |
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListeneraddOOMEventListener, removeOOMEventListener, startequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, yieldstartprotected final RouterContext _context
protected final Log _log
protected final ConsoleUpdateManager _mgr
protected final UpdateType _type
protected final UpdateMethod _method
protected final String _updateFile
protected volatile boolean _isRunning
protected boolean done
protected EepGet _get
protected boolean _isPartial
protected String _newVersion
protected final ByteArrayOutputStream _baos
protected URI _currentURI
protected static final long CONNECT_TIMEOUT
protected static final long INACTIVITY_TIMEOUT
protected static final long NOPROXY_INACTIVITY_TIMEOUT
public UpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, UpdateType type, List<URI> uris)
public UpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, UpdateType type, UpdateMethod method, List<URI> uris)
public UpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, UpdateType type, List<URI> uris, String currentVersion)
currentVersion - used for partial checkspublic UpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, UpdateType type, UpdateMethod method, List<URI> uris, String currentVersion)
method - HTTP, HTTP_CLEARNET, or HTTPS_CLEARNETcurrentVersion - used for partial checkspublic boolean isRunning()
isRunning in interface UpdateTaskpublic void shutdown()
shutdown in interface UpdateTaskpublic UpdateType getType()
getType in interface UpdateTaskpublic UpdateMethod getMethod()
getMethod in interface UpdateTaskpublic URI getURI()
UpdateTaskgetURI in interface UpdateTaskpublic String getID()
UpdateTaskgetID in interface UpdateTaskprotected void update()
public void attemptFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt, int numRetries, Exception cause)
attemptFailed in interface EepGet.StatusListenerpublic void bytesTransferred(long alreadyTransferred,
int currentWrite,
long bytesTransferred,
long bytesRemaining,
String url)
bytesTransferred in interface EepGet.StatusListenerpublic void transferComplete(long alreadyTransferred,
long bytesTransferred,
long bytesRemaining,
String url,
String outputFile,
boolean notModified)
transferComplete in interface EepGet.StatusListenerpublic void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt)
transferFailed in interface EepGet.StatusListenerpublic void headerReceived(String url, int attemptNum, String key, String val)
EepGet.StatusListenerheaderReceived in interface EepGet.StatusListenerpublic void attempting(String url)
attempting in interface EepGet.StatusListenerprotected void updateStatus(String s)