Class RPDownloadStats
- java.lang.Object
-
- com.biglybt.pifimpl.remote.RPObject
-
- com.biglybt.pifimpl.remote.download.RPDownloadStats
-
- All Implemented Interfaces:
DownloadStats
,java.io.Serializable
public class RPDownloadStats extends RPObject implements DownloadStats
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description float
availability
long
bytesUnavailable
int
completed
protected DownloadStats
delegate
long
download_average
int
downloadCompletedLive
int
downloadCompletedStored
long
downloaded
java.lang.String
eta
int
health
int
share_ratio
java.lang.String
status
java.lang.String
status_localised
long
upload_average
long
uploaded
-
Fields inherited from class com.biglybt.pifimpl.remote.RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse
-
Fields inherited from interface com.biglybt.pif.download.DownloadStats
HEALTH_ERROR, HEALTH_KO, HEALTH_NO_REMOTE, HEALTH_NO_TRACKER, HEALTH_OK, HEALTH_STOPPED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RPDownloadStats(DownloadStats _delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RPReply
_process(RPRequest request)
protected void
_setDelegate(java.lang.Object _delegate)
java.lang.Object
_setLocal()
static RPDownloadStats
create(DownloadStats _delegate)
float
getAvailability()
Gives the currently seen availability of the torrentlong
getBytesUnavailable()
Return the number of bytes of data fromt he torrent that is unavailable given the current sources (peers).int
getCheckingDoneInThousandNotation()
if isChecking then returns completeness, 1000 -> 100%int
getCompleted()
returns a value between 0 and 1000 giving the completion status of the current download task (e.g.long
getDiscarded()
Gives the number of bytes discarded.long
getDownloadAverage()
Gives average number of bytes downloaded in last secondlong
getDownloadAverage(boolean include_protocol)
int
getDownloadCompleted(boolean bLive)
Retrieve the level of download completion, *including* DND files.java.lang.String
getDownloadDirectory()
Gives access to the directory into which the download is being savedlong
getDownloaded()
Gives the number of bytes downloadedlong
getDownloaded(boolean include_protocol)
java.lang.String
getElapsedTime()
Gives the elapsed download time as a stringjava.lang.String
getETA()
Gives the estimated time to completion as a stringlong
getETASecs()
ETA time in seconds.long
getHashFails()
Gives the number of bytes thrown away due to piece hash check failsint
getHealth()
returns an indication of the health of the torrentlong
getRemaining()
Gives number of bytes remaining.long
getRemainingExcludingDND()
long
getSecondsDownloading()
Return the # of seconds that the torrent has been downloading.long
getSecondsOnlySeeding()
Return the # of seconds that the torrent has been only seeding.long
getSecondsSinceLastDownload()
Returns the number of seconds running time since data was downloaded, -1 if neverlong
getSecondsSinceLastUpload()
Returns the number of seconds running time since data was uploaded, -1 if neverint
getShareRatio()
Gives the share ratio of the torrent in 1000ths (i.e.java.lang.String
getStatus()
Returns an overall string representing the state of the downloadjava.lang.String
getStatus(boolean localised)
Returns an overall string representing the state of the download *localised*java.lang.String
getTargetFileOrDir()
Gives access to the target file or directory that the download is being saved tolong
getTimeStarted()
in ms since epochlong
getTimeStartedSeeding()
Time that the torrent started seeding.long
getTotalAverage()
Gives average number of bytes computed for torrent in last secondjava.lang.String
getTrackerStatus()
returns an general status string for the trackerlong
getUploadAverage()
Gives average number of bytes uploaded in last secondlong
getUploadAverage(boolean include_protocol)
long
getUploaded()
Gives the number of bytes uploadedlong
getUploaded(boolean include_protocol)
void
resetUploadedDownloaded(long l1, long l2)
resets totals.-
Methods inherited from class com.biglybt.pifimpl.remote.RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
-
-
-
-
Field Detail
-
delegate
protected transient DownloadStats delegate
-
downloaded
public long downloaded
-
uploaded
public long uploaded
-
completed
public int completed
-
downloadCompletedLive
public int downloadCompletedLive
-
downloadCompletedStored
public int downloadCompletedStored
-
status
public java.lang.String status
-
status_localised
public java.lang.String status_localised
-
upload_average
public long upload_average
-
download_average
public long download_average
-
eta
public java.lang.String eta
-
share_ratio
public int share_ratio
-
availability
public float availability
-
bytesUnavailable
public long bytesUnavailable
-
health
public int health
-
-
Constructor Detail
-
RPDownloadStats
protected RPDownloadStats(DownloadStats _delegate)
-
-
Method Detail
-
create
public static RPDownloadStats create(DownloadStats _delegate)
-
_setDelegate
protected void _setDelegate(java.lang.Object _delegate)
- Overrides:
_setDelegate
in classRPObject
-
_setLocal
public java.lang.Object _setLocal() throws RPException
- Overrides:
_setLocal
in classRPObject
- Throws:
RPException
-
getStatus
public java.lang.String getStatus()
Description copied from interface:DownloadStats
Returns an overall string representing the state of the download- Specified by:
getStatus
in interfaceDownloadStats
- Returns:
-
getStatus
public java.lang.String getStatus(boolean localised)
Description copied from interface:DownloadStats
Returns an overall string representing the state of the download *localised*- Specified by:
getStatus
in interfaceDownloadStats
- Returns:
-
getDownloadDirectory
public java.lang.String getDownloadDirectory()
Description copied from interface:DownloadStats
Gives access to the directory into which the download is being saved- Specified by:
getDownloadDirectory
in interfaceDownloadStats
- Returns:
-
getTargetFileOrDir
public java.lang.String getTargetFileOrDir()
Description copied from interface:DownloadStats
Gives access to the target file or directory that the download is being saved to- Specified by:
getTargetFileOrDir
in interfaceDownloadStats
- Returns:
-
getTrackerStatus
public java.lang.String getTrackerStatus()
Description copied from interface:DownloadStats
returns an general status string for the tracker- Specified by:
getTrackerStatus
in interfaceDownloadStats
- Returns:
-
getCompleted
public int getCompleted()
Description copied from interface:DownloadStats
returns a value between 0 and 1000 giving the completion status of the current download task (e.g. checking, downloading)- Specified by:
getCompleted
in interfaceDownloadStats
- Returns:
-
getDownloadCompleted
public int getDownloadCompleted(boolean bLive)
Description copied from interface:DownloadStats
Retrieve the level of download completion, *including* DND files. If the user has one or more DND file, return value will never reach 1000.To understand the bLive parameter, you must know a bit about the Torrent activation process:
1) Torrent goes into ST_WAITING
2) Torrent moves to ST_PREPARING
3) Torrent moves to ST_DOWNLOADING or ST_SEEDING
While in ST_PREPARING, Completion Level is rebuilt (either via Fast Resume or via piece checking). Quite often, the download completion level before ST_PREPARING and after ST_PREPARING are identical.
Before going into ST_PREPARING, we store the download completion level. If you wish to retrieve this value instead of the live "building" one, pass false for the parameter.
- Specified by:
getDownloadCompleted
in interfaceDownloadStats
- Parameters:
bLive
- true - Always returns the known completion level of the torrent false - In the case of ST_PREPARING, return completion level before of the torrent ST_PREPARING started. Otherwise, same as true.- Returns:
- 0 - 1000
-
getCheckingDoneInThousandNotation
public int getCheckingDoneInThousandNotation()
Description copied from interface:DownloadStats
if isChecking then returns completeness, 1000 -> 100%- Specified by:
getCheckingDoneInThousandNotation
in interfaceDownloadStats
- Returns:
-
resetUploadedDownloaded
public void resetUploadedDownloaded(long l1, long l2)
Description copied from interface:DownloadStats
resets totals. stops and restarts torrent if running to do so- Specified by:
resetUploadedDownloaded
in interfaceDownloadStats
-
getDownloaded
public long getDownloaded()
Description copied from interface:DownloadStats
Gives the number of bytes downloaded- Specified by:
getDownloaded
in interfaceDownloadStats
- Returns:
-
getDownloaded
public long getDownloaded(boolean include_protocol)
- Specified by:
getDownloaded
in interfaceDownloadStats
- Returns:
-
getUploaded
public long getUploaded()
Description copied from interface:DownloadStats
Gives the number of bytes uploaded- Specified by:
getUploaded
in interfaceDownloadStats
- Returns:
-
getUploaded
public long getUploaded(boolean include_protocol)
- Specified by:
getUploaded
in interfaceDownloadStats
- Returns:
-
getRemaining
public long getRemaining()
Description copied from interface:DownloadStats
Gives number of bytes remaining. *Includes* DND files- Specified by:
getRemaining
in interfaceDownloadStats
-
getDiscarded
public long getDiscarded()
Description copied from interface:DownloadStats
Gives the number of bytes discarded. Does not includeDownloadStats.getHashFails()
(ex. end game mode where multiple peers send same block, et)- Specified by:
getDiscarded
in interfaceDownloadStats
- Returns:
-
getDownloadAverage
public long getDownloadAverage()
Description copied from interface:DownloadStats
Gives average number of bytes downloaded in last second- Specified by:
getDownloadAverage
in interfaceDownloadStats
- Returns:
-
getDownloadAverage
public long getDownloadAverage(boolean include_protocol)
- Specified by:
getDownloadAverage
in interfaceDownloadStats
- Returns:
-
getUploadAverage
public long getUploadAverage()
Description copied from interface:DownloadStats
Gives average number of bytes uploaded in last second- Specified by:
getUploadAverage
in interfaceDownloadStats
- Returns:
-
getUploadAverage
public long getUploadAverage(boolean include_protocol)
- Specified by:
getUploadAverage
in interfaceDownloadStats
- Returns:
-
getTotalAverage
public long getTotalAverage()
Description copied from interface:DownloadStats
Gives average number of bytes computed for torrent in last second- Specified by:
getTotalAverage
in interfaceDownloadStats
- Returns:
-
getElapsedTime
public java.lang.String getElapsedTime()
Description copied from interface:DownloadStats
Gives the elapsed download time as a string- Specified by:
getElapsedTime
in interfaceDownloadStats
- Returns:
-
getETA
public java.lang.String getETA()
Description copied from interface:DownloadStats
Gives the estimated time to completion as a string- Specified by:
getETA
in interfaceDownloadStats
- Returns:
-
getETASecs
public long getETASecs()
Description copied from interface:DownloadStats
ETA time in seconds.- Specified by:
getETASecs
in interfaceDownloadStats
- Returns:
- 0 = download is complete.
< 0 = download is complete and it took -xxx time to complete.
-1 = unknown eta (no peer manager) or download completed 1s ago
315360000000L = incomplete and 0 average speed
-
getHashFails
public long getHashFails()
Description copied from interface:DownloadStats
Gives the number of bytes thrown away due to piece hash check fails- Specified by:
getHashFails
in interfaceDownloadStats
- Returns:
-
getShareRatio
public int getShareRatio()
Description copied from interface:DownloadStats
Gives the share ratio of the torrent in 1000ths (i.e. 1000 = share ratio of 1)- Specified by:
getShareRatio
in interfaceDownloadStats
- Returns:
-
getTimeStarted
public long getTimeStarted()
Description copied from interface:DownloadStats
in ms since epoch- Specified by:
getTimeStarted
in interfaceDownloadStats
-
getAvailability
public float getAvailability()
Description copied from interface:DownloadStats
Gives the currently seen availability of the torrent- Specified by:
getAvailability
in interfaceDownloadStats
- Returns:
-
getSecondsDownloading
public long getSecondsDownloading()
Description copied from interface:DownloadStats
Return the # of seconds that the torrent has been downloading. This number is totalled across sessions.- Specified by:
getSecondsDownloading
in interfaceDownloadStats
- Returns:
- -1 if it has never downloaded
-
getSecondsOnlySeeding
public long getSecondsOnlySeeding()
Description copied from interface:DownloadStats
Return the # of seconds that the torrent has been only seeding. This number is totalled across sessions, and does not include the time seeding during the download phase.- Specified by:
getSecondsOnlySeeding
in interfaceDownloadStats
- Returns:
- -1 if it has never seeded
-
getTimeStartedSeeding
public long getTimeStartedSeeding()
Description copied from interface:DownloadStats
Time that the torrent started seeding.- Specified by:
getTimeStartedSeeding
in interfaceDownloadStats
- Returns:
- the difference, measured in milliseconds, between the torrent started seeding and midnight, January 1, 1970 UTC. see SystemTime.getCurrentTime(). -1 is not seeding
-
getSecondsSinceLastDownload
public long getSecondsSinceLastDownload()
Description copied from interface:DownloadStats
Returns the number of seconds running time since data was downloaded, -1 if never- Specified by:
getSecondsSinceLastDownload
in interfaceDownloadStats
- Returns:
-
getSecondsSinceLastUpload
public long getSecondsSinceLastUpload()
Description copied from interface:DownloadStats
Returns the number of seconds running time since data was uploaded, -1 if never- Specified by:
getSecondsSinceLastUpload
in interfaceDownloadStats
- Returns:
-
getHealth
public int getHealth()
Description copied from interface:DownloadStats
returns an indication of the health of the torrent- Specified by:
getHealth
in interfaceDownloadStats
- Returns:
- see above HEALTH constants
-
getBytesUnavailable
public long getBytesUnavailable()
Description copied from interface:DownloadStats
Return the number of bytes of data fromt he torrent that is unavailable given the current sources (peers). Does not exclude DND files- Specified by:
getBytesUnavailable
in interfaceDownloadStats
- Returns:
- -1 if could not be determined
-
getRemainingExcludingDND
public long getRemainingExcludingDND()
- Specified by:
getRemainingExcludingDND
in interfaceDownloadStats
-
-