public class TorrentManager extends Object
| Constructor and Description |
|---|
TorrentManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTorrent(Torrent torrent)
Registers a new torrent
|
void |
enableConnectionAcceptor()
Attempts to start a server socket to accept incoming TCP connections.
|
Optional<Torrent> |
getTorrent(byte[] hash)
Gets the torrent associated with the given hash.
|
Collection<Torrent> |
getTorrents()
Creates a copy of the list containing the torrents
|
void |
removeTorrent(Torrent torrent)
Removes a torrent from the list
|
void |
shutdownTorrent(Torrent torrent)
Shuts down the torrent processing cleanly.
|
void |
start(TorrentClient torrentClient)
Starts the connnection listener which will accept new peers
|
void |
stop()
Gracefully stops the connection processing.
|
public void start(TorrentClient torrentClient)
public void enableConnectionAcceptor()
public void stop()
public void addTorrent(Torrent torrent)
torrent - The torrent to registerpublic void removeTorrent(Torrent torrent)
torrent - public void shutdownTorrent(Torrent torrent)
torrent - The torrent to stop.public Optional<Torrent> getTorrent(byte[] hash)
hash - The BTIH of the torrentpublic Collection<Torrent> getTorrents()
Copyright © 2016. All rights reserved.