planet.test.dht
Class DHTMessage

java.lang.Object
  extended byplanet.test.dht.DHTMessage
All Implemented Interfaces:
Message, java.io.Serializable

public class DHTMessage
extends java.lang.Object
implements Message

Message to be used at DHTTest main application. It permits two operations:

  1. Insert: Insert a key/value pair.
  2. Lookup: Lookup a key at ring.

Version:
1.0
Author:
Carles Pairot , Jordi Pujol
See Also:
Serialized Form

Field Summary
static int INSERT
          Insert message type to be used at constructor.
static int LOOKUP
          Lookup message type to be used at constructor.
 
Constructor Summary
DHTMessage(NodeHandle origNode, int type)
          Builds a new Message with the specified source Node origNode and specified type type
DHTMessage(NodeHandle origNode, int type, java.lang.String key, java.lang.String value)
          Builds a new Message with the specified source Node and type, containing initially the specified key/value pair.
DHTMessage(NodeHandle origNode, int type, java.lang.String key, java.util.Vector value)
          Builds a Message with the specifid source Node, type and key, with value a Vector with all values of the required key.
 
Method Summary
 java.lang.String getKey()
           
 NodeHandle getOriginNode()
           
 int getType()
           
 java.lang.String getValue()
           
 java.util.Vector getVectorValue()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSERT

public static final int INSERT
Insert message type to be used at constructor.

See Also:
Constant Field Values

LOOKUP

public static final int LOOKUP
Lookup message type to be used at constructor.

See Also:
Constant Field Values
Constructor Detail

DHTMessage

public DHTMessage(NodeHandle origNode,
                  int type)
Builds a new Message with the specified source Node origNode and specified type type

Parameters:
origNode -
type -

DHTMessage

public DHTMessage(NodeHandle origNode,
                  int type,
                  java.lang.String key,
                  java.lang.String value)
Builds a new Message with the specified source Node and type, containing initially the specified key/value pair.

Parameters:
origNode - Source node.
type - Type of message
key - Key of the pair.
value - Value of the pair.

DHTMessage

public DHTMessage(NodeHandle origNode,
                  int type,
                  java.lang.String key,
                  java.util.Vector value)
Builds a Message with the specifid source Node, type and key, with value a Vector with all values of the required key.

Parameters:
origNode - Source Node.
type - Type of message.
key - Key of the pair.
value - Value of the pair.
Method Detail

getOriginNode

public NodeHandle getOriginNode()

getType

public int getType()

getKey

public java.lang.String getKey()

getValue

public java.lang.String getValue()

getVectorValue

public java.util.Vector getVectorValue()

toString

public java.lang.String toString()