public class AnnounceEndpoint
extends java.lang.Object
This class is a lightweight version of the native announce_endpoint,
and only carries a subset of all the information. However, it's completely
open for custom use or optimization to accommodate client necessities.
| Modifier and Type | Field and Description |
|---|---|
protected int |
fails |
protected boolean |
isWorking |
protected ErrorCode |
lastError |
protected java.lang.String |
localEndpoint |
protected java.lang.String |
message |
protected long |
minAnnounce |
protected long |
nextAnnounce |
protected int |
scrapeComplete |
protected int |
scrapeDownloaded |
protected int |
scrapeIncomplete |
protected boolean |
updating |
| Constructor and Description |
|---|
AnnounceEndpoint(announce_endpoint e) |
| Modifier and Type | Method and Description |
|---|---|
int |
fails()
The number of times in a row we have failed to announce to this tracker.
|
protected void |
init(announce_endpoint e)
NOTE: use this with care and only if necessary.
|
boolean |
isWorking()
Returns true if the last time we tried to announce to this
tracker succeeded, or if we haven't tried yet.
|
ErrorCode |
lastError()
If this tracker failed the last time it was contacted
this error code specifies what error occurred.
|
java.lang.String |
localEndpoint()
The local endpoint of the listen interface associated with this endpoint.
|
java.lang.String |
message()
If this tracker has returned an error or warning message
that message is stored here.
|
long |
minAnnounce()
No announces before this time.
|
long |
nextAnnounce()
The time of next tracker announce in milliseconds.
|
int |
scrapeComplete()
This is either -1 or the scrape information this tracker last
responded with.
|
int |
scrapeDownloaded()
This is either -1 or the scrape information this tracker last
responded with.
|
int |
scrapeIncomplete()
This is either -1 or the scrape information this tracker last
responded with.
|
boolean |
updating()
True while we're waiting for a response from the tracker.
|
protected java.lang.String message
protected ErrorCode lastError
protected java.lang.String localEndpoint
protected long nextAnnounce
protected long minAnnounce
protected int scrapeIncomplete
protected int scrapeComplete
protected int scrapeDownloaded
protected int fails
protected boolean updating
protected boolean isWorking
public AnnounceEndpoint(announce_endpoint e)
e - the native objectpublic java.lang.String message()
public ErrorCode lastError()
public java.lang.String localEndpoint()
public long nextAnnounce()
public long minAnnounce()
public int scrapeIncomplete()
If this tracker has returned scrape data, these fields are filled in with valid numbers. Otherwise they are set to -1.
public int scrapeComplete()
If this tracker has returned scrape data, these fields are filled in with valid numbers. Otherwise they are set to -1.
public int scrapeDownloaded()
If this tracker has returned scrape data, these fields are filled in with valid numbers. Otherwise they are set to -1.
public int fails()
public boolean updating()
public boolean isWorking()
protected void init(announce_endpoint e)
e - the native object