Package org.johnnei.javatorrent.phases
Class PhaseData
- java.lang.Object
-
- org.johnnei.javatorrent.phases.PhaseData
-
- All Implemented Interfaces:
IDownloadPhase
public class PhaseData extends Object implements IDownloadPhase
The download phase in which the actual torrent files will be downloaded.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(TorrentClient torrentClient, Torrent torrent)Creates a new Data Phase for the given torrent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IChokingStrategygetChokingStrategy()Gets the choking strategy which is optimal for this phase.booleanisDone()Checks if the phase has been finishedvoidonPhaseEnter()Prepare the phasevoidonPhaseExit()Clean up the phasevoidprocess()Processing the phase of the torrent
-
-
-
Constructor Detail
-
PhaseData
public PhaseData(TorrentClient torrentClient, Torrent torrent)
Creates a new Data Phase for the given torrent.- Parameters:
torrentClient- The client used to notify trackers.torrent- The torrent which we are downloading.
-
-
Method Detail
-
isDone
public boolean isDone()
Description copied from interface:IDownloadPhaseChecks if the phase has been finished- Specified by:
isDonein interfaceIDownloadPhase- Returns:
- true if the phase can be ended
-
process
public void process()
Description copied from interface:IDownloadPhaseProcessing the phase of the torrent- Specified by:
processin interfaceIDownloadPhase
-
onPhaseEnter
public void onPhaseEnter()
Description copied from interface:IDownloadPhasePrepare the phase- Specified by:
onPhaseEnterin interfaceIDownloadPhase
-
onPhaseExit
public void onPhaseExit()
Description copied from interface:IDownloadPhaseClean up the phase- Specified by:
onPhaseExitin interfaceIDownloadPhase
-
getChokingStrategy
public IChokingStrategy getChokingStrategy()
Description copied from interface:IDownloadPhaseGets the choking strategy which is optimal for this phase.- Specified by:
getChokingStrategyin interfaceIDownloadPhase- Returns:
- The optimal choking strategy.
-
-