Package org.johnnei.javatorrent.module
Interface IModule
-
- All Known Implementing Classes:
HttpTrackerModule
public interface IModule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigureTorrentClient(TorrentClient.Builder builder)Registers all the mandatory components to theTorrentClient.Builder.List<Class<IModule>>getDependsOn()Returns the extensions which must be present to allow this module to work at all.intgetRelatedBep()Returns the number of the BEP to which this module is related.voidonBuild(TorrentClient torrentClient)Event called as the last method in the build process of theTorrentClient.Builder.build()call.voidonPostHandshake(Peer peer)Called when the peer has successfully passed the handshake with us.voidonShutdown()Event called when the TorrentClient is being shutdown.
-
-
-
Method Detail
-
configureTorrentClient
void configureTorrentClient(TorrentClient.Builder builder)
Registers all the mandatory components to theTorrentClient.Builder.- Parameters:
builder- The torrent client builder to which the module is being registered
-
getRelatedBep
int getRelatedBep()
Returns the number of the BEP to which this module is related. This is used to inform the user/developer for what extension this module is being used.- Returns:
- The related BEP number
-
getDependsOn
List<Class<IModule>> getDependsOn()
Returns the extensions which must be present to allow this module to work at all.- Returns:
- The list of required modules
-
onPostHandshake
void onPostHandshake(Peer peer) throws IOException
Called when the peer has successfully passed the handshake with us.- Parameters:
peer- The peer who passed the handshake- Throws:
IOException
-
onBuild
void onBuild(TorrentClient torrentClient) throws ModuleBuildException
Event called as the last method in the build process of theTorrentClient.Builder.build()call.- Throws:
ModuleBuildException- When the module can not build itself correctly
-
onShutdown
void onShutdown()
Event called when the TorrentClient is being shutdown.
-
-