planet.test.dht
Class ChordDHTMessage

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

public class ChordDHTMessage
extends java.lang.Object
implements Message

Message to be used at ChordDHT 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
ChordDHTMessage(java.lang.String origNode, int type)
          Builds a new Message with the specified source Node origNode and specified type type
ChordDHTMessage(java.lang.String 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.
ChordDHTMessage(java.lang.String 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()
           
 java.lang.String 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

ChordDHTMessage

public ChordDHTMessage(java.lang.String origNode,
                       int type)
Builds a new Message with the specified source Node origNode and specified type type

Parameters:
origNode -
type -

ChordDHTMessage

public ChordDHTMessage(java.lang.String 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.

ChordDHTMessage

public ChordDHTMessage(java.lang.String 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 java.lang.String 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()