Package org.klomp.snark
Class UpdateRunner
java.lang.Object
org.klomp.snark.UpdateRunner
- All Implemented Interfaces:
UpdateTask
,CompleteListener
class UpdateRunner extends Object implements UpdateTask, CompleteListener
The downloader for router signed updates.
- Since:
- 0.9.4
-
Constructor Summary
Constructors Constructor Description UpdateRunner(I2PAppContext ctx, UpdateManager umgr, SnarkManager smgr, UpdateType type, List<URI> uris, String newVersion)
-
Method Summary
Modifier and Type Method Description void
addMessage(Snark snark, String message)
void
fatal(Snark snark, String error)
String
getID()
Valid for pluginsUpdateMethod
getMethod()
CommentSet
getSavedComments(Snark snark)
boolean
getSavedPreserveNamesSetting(Snark snark)
BitField
getSavedTorrentBitField(Snark snark)
long
getSavedTorrentTime(Snark snark)
not really listeners but the easiest way to get back to an optional SnarkManagerlong
getSavedUploaded(Snark snark)
UpdateType
getType()
URI
getURI()
The current URI being checked or downloaded from.String
gotMetaInfo(Snark snark)
We transitioned from magnet mode, we have now initialized our metainfo and storage.void
gotPiece(Snark snark)
boolean
isRunning()
void
locked_saveComments(Snark snark, CommentSet comments)
boolean
shouldAutoStart()
void
shutdown()
void
start()
Tasks must not start themselves in the constructor.void
torrentComplete(Snark snark)
String
toString()
void
updateStatus(Snark snark)
This is called by stopTorrent() among others
-
Constructor Details
-
UpdateRunner
public UpdateRunner(I2PAppContext ctx, UpdateManager umgr, SnarkManager smgr, UpdateType type, List<URI> uris, String newVersion)
-
-
Method Details
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceUpdateTask
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceUpdateTask
-
getType
- Specified by:
getType
in interfaceUpdateTask
-
getMethod
- Specified by:
getMethod
in interfaceUpdateTask
-
getURI
Description copied from interface:UpdateTask
The current URI being checked or downloaded from. Can change if there are multiple URIs to try.- Specified by:
getURI
in interfaceUpdateTask
-
getID
Description copied from interface:UpdateTask
Valid for plugins- Specified by:
getID
in interfaceUpdateTask
-
start
public void start()Description copied from interface:UpdateTask
Tasks must not start themselves in the constructor. Do it here.- Specified by:
start
in interfaceUpdateTask
-
torrentComplete
- Specified by:
torrentComplete
in interfaceCompleteListener
-
updateStatus
This is called by stopTorrent() among others- Specified by:
updateStatus
in interfaceCompleteListener
-
gotMetaInfo
Description copied from interface:CompleteListener
We transitioned from magnet mode, we have now initialized our metainfo and storage. The listener should now call getMetaInfo() and save the data to disk.- Specified by:
gotMetaInfo
in interfaceCompleteListener
- Returns:
- the new name for the torrent or null on error
-
fatal
- Specified by:
fatal
in interfaceCompleteListener
-
addMessage
- Specified by:
addMessage
in interfaceCompleteListener
-
gotPiece
- Specified by:
gotPiece
in interfaceCompleteListener
-
getSavedTorrentTime
Description copied from interface:CompleteListener
not really listeners but the easiest way to get back to an optional SnarkManager- Specified by:
getSavedTorrentTime
in interfaceCompleteListener
-
getSavedTorrentBitField
- Specified by:
getSavedTorrentBitField
in interfaceCompleteListener
-
getSavedPreserveNamesSetting
- Specified by:
getSavedPreserveNamesSetting
in interfaceCompleteListener
-
getSavedUploaded
- Specified by:
getSavedUploaded
in interfaceCompleteListener
-
getSavedComments
- Specified by:
getSavedComments
in interfaceCompleteListener
- Since:
- 0.9.31
-
locked_saveComments
- Specified by:
locked_saveComments
in interfaceCompleteListener
- Since:
- 0.9.31
-
shouldAutoStart
public boolean shouldAutoStart()- Specified by:
shouldAutoStart
in interfaceCompleteListener
- Since:
- 0.9.42
-
toString
-