Package org.johnnei.javatorrent.phases
Class PhaseSeed
- java.lang.Object
-
- org.johnnei.javatorrent.phases.PhaseSeed
-
- All Implemented Interfaces:
IDownloadPhase
public class PhaseSeed extends Object implements IDownloadPhase
A phase which is meant to be used for seeding torrents. All peers which are considered seeders (having all pieces) will be disconnected. They aren't useful to us anymore.
-
-
Constructor Summary
Constructors Constructor Description PhaseSeed(TorrentClient torrentClient, Torrent torrent)Creates a new seeding phase.
-
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
-
PhaseSeed
public PhaseSeed(TorrentClient torrentClient, Torrent torrent)
Creates a new seeding phase.- Parameters:
torrentClient- The client on which this phase operates.torrent- The torrent for which this phase applies.- See Also:
PhaseRegulator.Builder.registerPhase(Class, BiFunction, Class)
-
-
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.
-
-