public class DefaultTorrentSessionState extends Object implements TorrentSessionState
UNKNOWN
Constructor and Description |
---|
DefaultTorrentSessionState(Supplier<DataDescriptor> descriptor,
TorrentWorker worker,
PrioritizedPieceSelector pieceSelector) |
Modifier and Type | Method and Description |
---|---|
Set<ConnectionKey> |
getConnectedPeers() |
long |
getDownloaded() |
long |
getLeft()
Get the number of bytes left to verify, or
TorrentSessionState.UNKNOWN if unknown (torrent not yet fetched) |
int |
getPiecesComplete() |
int |
getPiecesIncomplete() |
int |
getPiecesNotSkipped() |
int |
getPiecesRemaining() |
int |
getPiecesSkipped() |
int |
getPiecesTotal() |
long |
getUploaded() |
boolean |
startedAsSeed()
Check if the torrent was finished upon initial hashing
|
boolean |
updateFileDownloadPriority(ProcessingContext c,
FilePrioritySelector prioritySelector)
Update the priority of downloading specified files
|
public DefaultTorrentSessionState(Supplier<DataDescriptor> descriptor, TorrentWorker worker, PrioritizedPieceSelector pieceSelector)
public int getPiecesTotal()
getPiecesTotal
in interface TorrentSessionState
public int getPiecesComplete()
getPiecesComplete
in interface TorrentSessionState
public int getPiecesIncomplete()
getPiecesIncomplete
in interface TorrentSessionState
public int getPiecesRemaining()
getPiecesRemaining
in interface TorrentSessionState
public int getPiecesSkipped()
getPiecesSkipped
in interface TorrentSessionState
public int getPiecesNotSkipped()
getPiecesNotSkipped
in interface TorrentSessionState
public long getDownloaded()
getDownloaded
in interface TorrentSessionState
public long getUploaded()
getUploaded
in interface TorrentSessionState
public long getLeft()
TorrentSessionState
TorrentSessionState.UNKNOWN
if unknown (torrent not yet fetched)getLeft
in interface TorrentSessionState
public boolean startedAsSeed()
TorrentSessionState
startedAsSeed
in interface TorrentSessionState
public Set<ConnectionKey> getConnectedPeers()
getConnectedPeers
in interface TorrentSessionState
public boolean updateFileDownloadPriority(ProcessingContext c, FilePrioritySelector prioritySelector)
TorrentSessionState
updateFileDownloadPriority
in interface TorrentSessionState
c
- The processing context of the torrentprioritySelector
- the files to update the priority forCopyright © 2016–2021. All rights reserved.