p2p.simulator.message
Class InsertResponse

java.lang.Object
  extended by p2p.simulator.message.MessageBody
      extended by p2p.simulator.message.LookupResponse
          extended by p2p.simulator.message.InsertResponse
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class InsertResponse
extends LookupResponse

This class creates a special lookup response message body. This special message is used to extract statistics regarding the protocol's lookup algorithm.

See Also:
Serialized Form

Constructor Summary
InsertResponse(long key, boolean exist, Message msg)
          Creates the body message of an insert response message.
 
Method Summary
 int getType()
          Returns the message's type.
 java.lang.String toString()
           
 
Methods inherited from class p2p.simulator.message.LookupResponse
getHops
 
Methods inherited from class p2p.simulator.message.MessageBody
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InsertResponse

public InsertResponse(long key,
                      boolean exist,
                      Message msg)
Creates the body message of an insert response message.

Parameters:
key - The key of the lookup request.
exist - If the key is found is true, otherwise false.
msg - The initial lookup request message.
Method Detail

getType

public int getType()
Returns the message's type.

Overrides:
getType in class LookupResponse
Returns:
The type of the message

toString

public java.lang.String toString()
Overrides:
toString in class LookupResponse