com.aelitis.azureus.core.peermanager.peerdb
Class PeerItem

java.lang.Object
  extended by 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)
           
 
Method Summary
 int compareTo(PeerItem other)
           
static byte convertSourceID(String source)
           
static String convertSourceString(byte source_id)
           
 boolean equals(Object obj)
           
 String getAddressString()
           
 byte getCryptoLevel()
           
 byte getHandshakeType()
           
 String getIP()
           
 String getNetwork()
           
 String getPeerSource()
          source as defined in DownloadAnnounceResultPeer
 long getPriority()
           
 byte[] getSerialization()
           
 byte getSource()
           
 int getTCPPort()
           
 int getUDPPort()
           
 int hashCode()
           
 boolean isIPv4()
           
 boolean useCrypto()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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()