org.gudy.azureus2.core3.tracker.server.impl
Class TRTrackerServerPeerImpl
java.lang.Object
org.gudy.azureus2.core3.tracker.server.impl.TRTrackerServerPeerImpl
- All Implemented Interfaces:
- TRTrackerServerNatCheckerListener, TRTrackerServerSimplePeer, TRTrackerServerPeer, TRTrackerServerPeerBase, HostNameToIPResolverListener
public class TRTrackerServerPeerImpl
- extends Object
- implements TRTrackerServerPeer, TRTrackerServerSimplePeer, HostNameToIPResolverListener, TRTrackerServerNatCheckerListener
Constructor Summary |
protected |
TRTrackerServerPeerImpl(HashWrapper _peer_id,
int _key_hash_code,
byte[] _ip,
boolean _ip_override,
int _tcp_port,
int _udp_port,
int _http_port,
byte _crypto_level,
byte _az_ver,
long _last_contact_time,
boolean _download_completed,
byte _last_nat_status,
int _up_speed,
DHTNetworkPosition _network_position)
|
protected |
TRTrackerServerPeerImpl(HashWrapper _peer_id,
int _key_hash_code,
byte[] _ip,
boolean _ip_override,
short _tcp_port,
short _udp_port,
short _http_port,
byte _crypto_level,
byte _az_ver,
String _ip_str,
byte[] _ip_bytes,
byte _NAT_status,
long _timeout,
long _uploaded,
long _downloaded,
long _amount_left,
long _last_contact_time,
boolean _download_completed,
boolean _biased,
short _up_speed)
Import constructor |
Method Summary |
Map |
export()
|
long |
getAmountLeft()
|
byte |
getAZVer()
|
byte |
getCryptoLevel()
|
protected boolean |
getDownloadCompleted()
|
long |
getDownloaded()
|
int |
getHTTPPort()
|
String |
getIP()
If asynchronous resolution of the address is required, this will return
the non-resolved address until the async process completes |
byte[] |
getIPAddressBytes()
This will return in resolution of the address is not complete or fails |
byte[] |
getIPAsRead()
|
String |
getIPRaw()
|
protected int |
getKeyHashCode()
|
protected long |
getLastContactTime()
|
byte |
getNATStatus()
returns the current NAT status of the peer |
DHTNetworkPosition |
getNetworkPosition()
|
HashWrapper |
getPeerId()
|
byte[] |
getPeerID()
|
int |
getSecsToLive()
|
protected String |
getString()
|
int |
getTCPPort()
|
protected long |
getTimeout()
|
int |
getUDPPort()
|
long |
getUploaded()
|
int |
getUpSpeed()
|
Object |
getUserData(Object key)
|
void |
hostNameResolutionComplete(InetAddress address)
|
static TRTrackerServerPeerImpl |
importPeer(Map map)
|
boolean |
isBiased()
|
protected boolean |
isIPOverride()
|
protected boolean |
isNATStatusBad()
|
boolean |
isSeed()
|
void |
NATCheckComplete(boolean ok)
|
protected void |
resolveAndCheckNAT()
|
void |
setBiased(boolean _biased)
|
protected void |
setDownloadCompleted()
|
protected void |
setNATStatus(byte status)
|
protected void |
setStats(long _uploaded,
long _downloaded,
long _amount_left)
|
protected void |
setTimeout(long _now,
long _timeout)
|
void |
setUserData(Object key,
Object data)
|
protected boolean |
update(byte[] _ip,
int _port,
int _udp_port,
int _http_port,
byte _crypto_level,
byte _az_ver,
int _up_speed,
DHTNetworkPosition _network_position)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TRTrackerServerPeerImpl
protected TRTrackerServerPeerImpl(HashWrapper _peer_id,
int _key_hash_code,
byte[] _ip,
boolean _ip_override,
int _tcp_port,
int _udp_port,
int _http_port,
byte _crypto_level,
byte _az_ver,
long _last_contact_time,
boolean _download_completed,
byte _last_nat_status,
int _up_speed,
DHTNetworkPosition _network_position)
TRTrackerServerPeerImpl
protected TRTrackerServerPeerImpl(HashWrapper _peer_id,
int _key_hash_code,
byte[] _ip,
boolean _ip_override,
short _tcp_port,
short _udp_port,
short _http_port,
byte _crypto_level,
byte _az_ver,
String _ip_str,
byte[] _ip_bytes,
byte _NAT_status,
long _timeout,
long _uploaded,
long _downloaded,
long _amount_left,
long _last_contact_time,
boolean _download_completed,
boolean _biased,
short _up_speed)
- Import constructor
update
protected boolean update(byte[] _ip,
int _port,
int _udp_port,
int _http_port,
byte _crypto_level,
byte _az_ver,
int _up_speed,
DHTNetworkPosition _network_position)
NATCheckComplete
public void NATCheckComplete(boolean ok)
- Specified by:
NATCheckComplete
in interface TRTrackerServerNatCheckerListener
setNATStatus
protected void setNATStatus(byte status)
getNATStatus
public byte getNATStatus()
- Description copied from interface:
TRTrackerServerPeer
- returns the current NAT status of the peer
- Specified by:
getNATStatus
in interface TRTrackerServerPeer
- Returns:
isNATStatusBad
protected boolean isNATStatusBad()
resolveAndCheckNAT
protected void resolveAndCheckNAT()
hostNameResolutionComplete
public void hostNameResolutionComplete(InetAddress address)
- Specified by:
hostNameResolutionComplete
in interface HostNameToIPResolverListener
- Parameters:
address
- null if resolution failed
getLastContactTime
protected long getLastContactTime()
getDownloadCompleted
protected boolean getDownloadCompleted()
setDownloadCompleted
protected void setDownloadCompleted()
isBiased
public boolean isBiased()
- Specified by:
isBiased
in interface TRTrackerServerSimplePeer
- Specified by:
isBiased
in interface TRTrackerServerPeer
setBiased
public void setBiased(boolean _biased)
- Specified by:
setBiased
in interface TRTrackerServerPeer
getPeerId
public HashWrapper getPeerId()
- Specified by:
getPeerId
in interface TRTrackerServerSimplePeer
getPeerID
public byte[] getPeerID()
- Specified by:
getPeerID
in interface TRTrackerServerPeer
getKeyHashCode
protected int getKeyHashCode()
getIPAsRead
public byte[] getIPAsRead()
- Specified by:
getIPAsRead
in interface TRTrackerServerSimplePeer
getIPRaw
public String getIPRaw()
- Specified by:
getIPRaw
in interface TRTrackerServerPeer
getIP
public String getIP()
- If asynchronous resolution of the address is required, this will return
the non-resolved address until the async process completes
- Specified by:
getIP
in interface TRTrackerServerPeerBase
isIPOverride
protected boolean isIPOverride()
getIPAddressBytes
public byte[] getIPAddressBytes()
- This will return in resolution of the address is not complete or fails
- Specified by:
getIPAddressBytes
in interface TRTrackerServerSimplePeer
- Returns:
getTCPPort
public int getTCPPort()
- Specified by:
getTCPPort
in interface TRTrackerServerSimplePeer
- Specified by:
getTCPPort
in interface TRTrackerServerPeerBase
getUDPPort
public int getUDPPort()
- Specified by:
getUDPPort
in interface TRTrackerServerSimplePeer
getHTTPPort
public int getHTTPPort()
- Specified by:
getHTTPPort
in interface TRTrackerServerSimplePeer
- Specified by:
getHTTPPort
in interface TRTrackerServerPeerBase
getCryptoLevel
public byte getCryptoLevel()
- Specified by:
getCryptoLevel
in interface TRTrackerServerSimplePeer
getAZVer
public byte getAZVer()
- Specified by:
getAZVer
in interface TRTrackerServerSimplePeer
getUpSpeed
public int getUpSpeed()
- Specified by:
getUpSpeed
in interface TRTrackerServerSimplePeer
getNetworkPosition
public DHTNetworkPosition getNetworkPosition()
- Specified by:
getNetworkPosition
in interface TRTrackerServerSimplePeer
setTimeout
protected void setTimeout(long _now,
long _timeout)
getTimeout
protected long getTimeout()
getSecsToLive
public int getSecsToLive()
- Specified by:
getSecsToLive
in interface TRTrackerServerPeerBase
setStats
protected void setStats(long _uploaded,
long _downloaded,
long _amount_left)
getUploaded
public long getUploaded()
- Specified by:
getUploaded
in interface TRTrackerServerPeer
getDownloaded
public long getDownloaded()
- Specified by:
getDownloaded
in interface TRTrackerServerPeer
getAmountLeft
public long getAmountLeft()
- Specified by:
getAmountLeft
in interface TRTrackerServerPeer
isSeed
public boolean isSeed()
- Specified by:
isSeed
in interface TRTrackerServerSimplePeer
setUserData
public void setUserData(Object key,
Object data)
- Specified by:
setUserData
in interface TRTrackerServerPeer
getUserData
public Object getUserData(Object key)
- Specified by:
getUserData
in interface TRTrackerServerPeer
export
public Map export()
- Specified by:
export
in interface TRTrackerServerPeer
importPeer
public static TRTrackerServerPeerImpl importPeer(Map map)
getString
protected String getString()