ucr.core
Class TraceReplyMessage

java.lang.Object
  extended byucr.core.Message
      extended byucr.core.TraceReplyMessage

public class TraceReplyMessage
extends Message

TraceReply message, response to a trace request


Field Summary
private  java.util.Vector traceRecords
           
 
Fields inherited from class ucr.core.Message
guid, hops, originatingConnection, payload, payloadSize, QUERY, QUERYREPLY, SIZE, SIZE_QUERY_PAYLOAD, SIZE_QUERYREPLY_PAYLOAD, TRACE, TRACEREPLY, ttl, type
 
Constructor Summary
(package private) TraceReplyMessage()
           
  TraceReplyMessage(GUID traceGUID)
          Used to respond to a trace message
(package private) TraceReplyMessage(short[] rawMessage, Connection originatingConnection)
          Construct a trace reply message from data read read from network
 
Method Summary
 void addFileRecord(TraceRecord traceRecord)
          Adds a file record.
(package private)  void buildPayload()
          Contructs the payload for the search reply message Used when SENDING a message
(package private)  void buildVector()
           
(package private)  byte[] getByteArray()
          Produces a byte[] suitable for GNUTELLA network
 java.util.Vector getTraceRecords()
          Get the vector of trace records Remember that at this point everything is in raw data stored in the payload.
 
Methods inherited from class ucr.core.Message
addPayload, addPayload, getGUID, getHops, getOriginatingConnection, getPayload, getPayloadLength, getTTL, getType, setGUID, setHops, setTTL, toRawString, toString, validatePayloadSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

traceRecords

private java.util.Vector traceRecords
Constructor Detail

TraceReplyMessage

TraceReplyMessage()

TraceReplyMessage

public TraceReplyMessage(GUID traceGUID)
Used to respond to a trace message

Parameters:
traceGUID - the guid of the trace message

TraceReplyMessage

TraceReplyMessage(short[] rawMessage,
                  Connection originatingConnection)
Construct a trace reply message from data read read from network

Parameters:
rawMessage - binary data from a connection
originatingConnection - Connection creating this message
Method Detail

buildPayload

void buildPayload()
Contructs the payload for the search reply message Used when SENDING a message


addFileRecord

public void addFileRecord(TraceRecord traceRecord)
Adds a file record. This is for originating a message for a tracehit.

Parameters:
traceRecord - file information

getTraceRecords

public java.util.Vector getTraceRecords()
Get the vector of trace records Remember that at this point everything is in raw data stored in the payload. We need to unscrubble the sent data and generate the vector of filerecords. Used when RECEIVING a message


buildVector

void buildVector()

getByteArray

byte[] getByteArray()
Produces a byte[] suitable for GNUTELLA network

Overrides:
getByteArray in class Message