com.aelitis.azureus.core.peermanager.peerdb
Class PeerItem
java.lang.Object
com.aelitis.azureus.core.peermanager.peerdb.PeerItem
- All Implemented Interfaces:
- PeerDescriptor
public class PeerItem
- extends Object
- implements PeerDescriptor
Represents a peer item, unique by ip address + port combo.
NOTE: Overrides equals().
Constructor Summary |
protected |
PeerItem(byte[] _serialization,
byte _source,
byte _handshake,
int _udp_port,
String _network)
|
protected |
PeerItem(String _address,
int _tcp_port,
byte _source,
byte _handshake,
int _udp_port,
byte _crypto_level,
int _up_speed)
|
PeerItem
protected PeerItem(String _address,
int _tcp_port,
byte _source,
byte _handshake,
int _udp_port,
byte _crypto_level,
int _up_speed)
PeerItem
protected PeerItem(byte[] _serialization,
byte _source,
byte _handshake,
int _udp_port,
String _network)
throws Exception
- Throws:
Exception
getSerialization
public byte[] getSerialization()
getAddressString
public String getAddressString()
getIP
public String getIP()
- Specified by:
getIP
in interface PeerDescriptor
getNetwork
public String getNetwork()
getTCPPort
public int getTCPPort()
- Specified by:
getTCPPort
in interface PeerDescriptor
getUDPPort
public int getUDPPort()
- Specified by:
getUDPPort
in interface PeerDescriptor
getSource
public byte getSource()
getPeerSource
public String getPeerSource()
- Description copied from interface:
PeerDescriptor
- source as defined in DownloadAnnounceResultPeer
- Specified by:
getPeerSource
in interface PeerDescriptor
- Returns:
getHandshakeType
public byte getHandshakeType()
getCryptoLevel
public byte getCryptoLevel()
useCrypto
public boolean useCrypto()
- Specified by:
useCrypto
in interface PeerDescriptor
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
compareTo
public int compareTo(PeerItem other)
getPriority
public long getPriority()
convertSourceString
public static String convertSourceString(byte source_id)
convertSourceID
public static byte convertSourceID(String source)
isIPv4
public boolean isIPv4()