|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.router.update.UpdateRunner
class UpdateRunner
The downloader for router signed updates, and the base class for all the other Checkers and Runners.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.i2p.util.I2PThread |
---|
I2PThread.OOMEventListener |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
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 ConsoleUpdateManager |
_mgr
|
protected String |
_newVersion
set by the listeners on completion |
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
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
UpdateRunner(RouterContext ctx,
ConsoleUpdateManager mgr,
List<URI> uris)
|
Method Summary | |
---|---|
protected String |
_(String s)
translate a string |
protected String |
_(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()
private void log(int level, String msg) { log(level, msg, null); } private void log(int level, String msg, Throwable t) { // we cant assume log is created if (_log == null) _log = new Log(I2PThread.class); if (_log.shouldLog(level)) _log.log(level, msg, t); } |
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)
|
Methods inherited from class net.i2p.util.I2PAppThread |
---|
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListener |
Methods inherited from class net.i2p.util.I2PThread |
---|
addOOMEventListener, removeOOMEventListener |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.i2p.update.UpdateTask |
---|
start |
Field Detail |
---|
protected final RouterContext _context
protected final Log _log
protected final ConsoleUpdateManager _mgr
protected final List<URI> _urls
protected final String _updateFile
protected volatile boolean _isRunning
protected boolean done
protected EepGet _get
protected boolean _isPartial
protected String _newVersion
protected URI _currentURI
protected static final long CONNECT_TIMEOUT
protected static final long INACTIVITY_TIMEOUT
protected static final long NOPROXY_INACTIVITY_TIMEOUT
Constructor Detail |
---|
public UpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, List<URI> uris)
Method Detail |
---|
public boolean isRunning()
isRunning
in interface UpdateTask
public void shutdown()
shutdown
in interface UpdateTask
public UpdateType getType()
getType
in interface UpdateTask
public UpdateMethod getMethod()
getMethod
in interface UpdateTask
public URI getURI()
UpdateTask
getURI
in interface UpdateTask
public String getID()
UpdateTask
getID
in interface UpdateTask
public void run()
I2PThread
run
in interface Runnable
run
in class I2PThread
protected void update()
public void attemptFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt, int numRetries, Exception cause)
attemptFailed
in interface EepGet.StatusListener
public void bytesTransferred(long alreadyTransferred, int currentWrite, long bytesTransferred, long bytesRemaining, String url)
bytesTransferred
in interface EepGet.StatusListener
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified)
transferComplete
in interface EepGet.StatusListener
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt)
transferFailed
in interface EepGet.StatusListener
public void headerReceived(String url, int attemptNum, String key, String val)
EepGet.StatusListener
headerReceived
in interface EepGet.StatusListener
public void attempting(String url)
attempting
in interface EepGet.StatusListener
protected void updateStatus(String s)
protected static String linkify(String url)
protected String _(String s)
protected String _(String s, Object o)
public String toString()
toString
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |