public interface TorrentRegistry
Modifier and Type | Method and Description |
---|---|
Optional<TorrentDescriptor> |
getDescriptor(Torrent torrent)
Deprecated.
since 1.3 in favor of
getDescriptor(TorrentId) |
Optional<TorrentDescriptor> |
getDescriptor(TorrentId torrentId)
Get a torrent descriptor for a given torrent, if exists.
|
TorrentDescriptor |
getOrCreateDescriptor(Torrent torrent,
Storage storage)
Deprecated.
since 1.3 in favor of more clearly named
register(Torrent, Storage, FileDownloadCompleteCallback) |
Optional<Torrent> |
getTorrent(TorrentId torrentId)
Get a torrent with a given torrent ID, if exists.
|
Collection<TorrentId> |
getTorrentIds()
Get all torrents, that have been registered in the runtime.
|
Collection<Torrent> |
getTorrents()
Get all torrents, that have been registered in the runtime.
|
boolean |
isSupportedAndActive(TorrentId torrentId) |
TorrentDescriptor |
register(TorrentId torrentId)
Get an existing torrent descriptor for a given torrent ID
or create a new one if it does not exist.
|
TorrentDescriptor |
register(Torrent torrent,
Storage storage,
FileDownloadCompleteCallback fileCompletionCallback)
Get an existing torrent descriptor for a given torrent
or create a new one if it does not exist.
|
void |
registerSessionState(TorrentId torrentId,
TorrentSessionState state)
Register a session state for the specified torrent
|
Collection<Torrent> getTorrents()
Collection<TorrentId> getTorrentIds()
Optional<Torrent> getTorrent(TorrentId torrentId)
Optional.empty()
if this torrent ID is not known to the current runtime.Optional<TorrentDescriptor> getDescriptor(Torrent torrent)
getDescriptor(TorrentId)
Optional.empty()
if torrent descriptor hasn't been created yet.Optional<TorrentDescriptor> getDescriptor(TorrentId torrentId)
Optional.empty()
if torrent descriptor hasn't been created yet.TorrentDescriptor getOrCreateDescriptor(Torrent torrent, Storage storage)
register(Torrent, Storage, FileDownloadCompleteCallback)
storage
- Storage to use for storing this torrent's files.
Will be used when creating a new torrent descriptor.TorrentDescriptor register(Torrent torrent, Storage storage, FileDownloadCompleteCallback fileCompletionCallback)
storage
- Storage to use for storing this torrent's files.
Will be used when creating a new torrent descriptor.void registerSessionState(TorrentId torrentId, TorrentSessionState state)
torrentId
- the torrent idstate
- the session state of the torrentTorrentDescriptor register(TorrentId torrentId)
boolean isSupportedAndActive(TorrentId torrentId)
Copyright © 2016–2021. All rights reserved.