Package org.johnnei.javatorrent.phases
Class PhaseRegulator
- java.lang.Object
-
- org.johnnei.javatorrent.phases.PhaseRegulator
-
public class PhaseRegulator extends Object
The system which is being used to configure the transitions betweenIDownloadPhases.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPhaseRegulator.BuilderA builder-pattern styled class to created thePhaseRegulatorconfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDownloadPhasecreateInitialPhase(TorrentClient torrentClient, Torrent torrent)Creates an instance of the initialIDownloadPhasefor the givenTorrent.Optional<IDownloadPhase>createNextPhase(IDownloadPhase phase, TorrentClient torrentClient, Torrent torrent)Creates an instance of the nextIDownloadPhasefor the givenTorrent.StringtoString()
-
-
-
Method Detail
-
createInitialPhase
public IDownloadPhase createInitialPhase(TorrentClient torrentClient, Torrent torrent)
Creates an instance of the initialIDownloadPhasefor the givenTorrent.- Parameters:
torrentClient- The client on which the torrent is registeredtorrent- The torrent for which the phase is created.- Returns:
- The newly created
IDownloadPhaseinstance.
-
createNextPhase
public Optional<IDownloadPhase> createNextPhase(IDownloadPhase phase, TorrentClient torrentClient, Torrent torrent)
Creates an instance of the nextIDownloadPhasefor the givenTorrent.- Parameters:
phase- The phase which has been completed.torrentClient- The client on which the torrent is registeredtorrent- The torrent for which the phase is created.- Returns:
- The newly created
IDownloadPhaseinstance.
-
-