FileDocCategorySizeDatePackage
DHTUDPPacketReplyStats.javaAPI DocAzureus 3.0.3.43526Tue May 02 01:55:54 BST 2006com.aelitis.azureus.core.dht.transport.udp.impl

DHTUDPPacketReplyStats

public class DHTUDPPacketReplyStats extends DHTUDPPacketReply
author
parg

Fields Summary
private int
stats_type
private com.aelitis.azureus.core.dht.transport.DHTTransportFullStats
original_stats
private byte[]
new_stats
Constructors Summary
public DHTUDPPacketReplyStats(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_STATS, trans_id, conn_id, local_contact, remote_contact );
	
protected DHTUDPPacketReplyStats(com.aelitis.azureus.core.dht.transport.udp.impl.packethandler.DHTUDPPacketNetworkHandler network_handler, DataInputStream is, int trans_id)

		super( network_handler, is, DHTUDPPacketHelper.ACT_REPLY_STATS, trans_id );
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_GENERIC_NETPOS ){

			stats_type = is.readInt();
			
			if ( stats_type == DHTUDPPacketRequestStats.STATS_TYPE_ORIGINAL ){
				
				original_stats = DHTUDPUtils.deserialiseStats( getProtocolVersion(), is );
				
			}else{
				
				new_stats = DHTUDPUtils.deserialiseByteArray( is, 65535 );
			}
		}else{
			
			original_stats = DHTUDPUtils.deserialiseStats( getProtocolVersion(), is );
		}
	
Methods Summary
public byte[]getNewStats()

		return( new_stats );
	
public com.aelitis.azureus.core.dht.transport.DHTTransportFullStatsgetOriginalStats()

		return( original_stats );
	
public intgetStatsType()

		return( stats_type );
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_GENERIC_NETPOS ){

			os.writeInt( stats_type );
			
			if ( stats_type == DHTUDPPacketRequestStats.STATS_TYPE_ORIGINAL ){
				
				DHTUDPUtils.serialiseStats( getProtocolVersion(), os, original_stats );
				
			}else{
				
				DHTUDPUtils.serialiseByteArray( os, new_stats, 65535 );
			}
			
		}else{
			
			DHTUDPUtils.serialiseStats( getProtocolVersion(), os, original_stats );
		}
	
public voidsetNewStats(byte[] _stats, int _stats_type)

		stats_type		= _stats_type;
		new_stats		= _stats;
	
public voidsetOriginalStats(com.aelitis.azureus.core.dht.transport.DHTTransportFullStats _stats)

		stats_type		= DHTUDPPacketRequestStats.STATS_TYPE_ORIGINAL;
		original_stats	= _stats;