Package org.klomp.snark
Class UpdateRunner
java.lang.Object
org.klomp.snark.UpdateRunner
- All Implemented Interfaces:
UpdateTask
,CompleteListener
The downloader for router signed updates.
- Since:
- 0.9.4
-
Constructor Summary
ConstructorDescriptionUpdateRunner
(I2PAppContext ctx, UpdateManager umgr, SnarkManager smgr, UpdateType type, List<URI> uris, String newVersion) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(Snark snark, String message) void
getID()
Valid for pluginsgetSavedComments
(Snark snark) boolean
getSavedTorrentBitField
(Snark snark) long
getSavedTorrentTime
(Snark snark) not really listeners but the easiest way to get back to an optional SnarkManagerlong
getSavedUploaded
(Snark snark) getType()
getURI()
The current URI being checked or downloaded from.gotMetaInfo
(Snark snark) We transitioned from magnet mode, we have now initialized our metainfo and storage.void
boolean
void
locked_saveComments
(Snark snark, CommentSet comments) boolean
void
shutdown()
void
start()
Tasks must not start themselves in the constructor.void
torrentComplete
(Snark snark) 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
-