FileDocCategorySizeDatePackage
DHTUDPPacketReplyFindNode.javaAPI DocAzureus 3.0.3.43958Mon Apr 24 13:20:30 BST 2006com.aelitis.azureus.core.dht.transport.udp.impl

DHTUDPPacketReplyFindNode

public class DHTUDPPacketReplyFindNode extends DHTUDPPacketReply
author
parg

Fields Summary
private com.aelitis.azureus.core.dht.transport.DHTTransportContact[]
contacts
private int
random_id
private int
node_status
private int
estimated_dht_size
Constructors Summary
public DHTUDPPacketReplyFindNode(DHTTransportUDPImpl transport, int trans_id, long conn_id, com.aelitis.azureus.core.dht.transport.DHTTransportContact local_contact, com.aelitis.azureus.core.dht.transport.DHTTransportContact remote_contact)

	
	
	
				
								
							
				
				 
	
		super( transport, DHTUDPPacketHelper.ACT_REPLY_FIND_NODE, trans_id, conn_id, local_contact, remote_contact );
	
protected DHTUDPPacketReplyFindNode(com.aelitis.azureus.core.dht.transport.udp.impl.packethandler.DHTUDPPacketNetworkHandler network_handler, DataInputStream is, int trans_id)

		super( network_handler, is, DHTUDPPacketHelper.ACT_REPLY_FIND_NODE, trans_id );
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_ANTI_SPOOF ){
			
			random_id	= is.readInt();
		}		
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_XFER_STATUS ){
			
			node_status = is.readInt();
		}	
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_SIZE_ESTIMATE ){

			estimated_dht_size	= is.readInt();
		}
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_VIVALDI ){

			DHTUDPUtils.deserialiseVivaldi( this, is );
		}
		
		contacts = DHTUDPUtils.deserialiseContacts( getTransport(), is );
	
Methods Summary
protected com.aelitis.azureus.core.dht.transport.DHTTransportContact[]getContacts()

		return( contacts );
	
protected intgetEstimatedDHTSize()

		return( estimated_dht_size );
	
protected intgetNodeStatus()

		return( node_status );
	
protected intgetRandomID()

		return( random_id );
	
public java.lang.StringgetString()

		return( super.getString() + ",contacts=" + (contacts==null?"null":(""+contacts.length ))); 
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_ANTI_SPOOF ){
			
			os.writeInt( random_id );
		}

		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_XFER_STATUS ){
			
			 os.writeInt( node_status );
		}
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_SIZE_ESTIMATE ){
			
			 os.writeInt( estimated_dht_size );
		}
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_VIVALDI ){

			DHTUDPUtils.serialiseVivaldi( this, os );
		}
		
		DHTUDPUtils.serialiseContacts( os, contacts );
	
protected voidsetContacts(com.aelitis.azureus.core.dht.transport.DHTTransportContact[] _contacts)

		contacts	= _contacts;
	
protected voidsetEstimatedDHTSize(int s)

		estimated_dht_size	= s;
	
protected voidsetNodeStatus(int ns)

		node_status	= ns;
	
protected voidsetRandomID(int _random_id)

		random_id	= _random_id;