planet.test.GML.GMLTopology
Class DHTMessage

java.lang.Object
  extended by planet.test.GML.GMLTopology.DHTMessage
All Implemented Interfaces:
java.io.Serializable, Message

public class DHTMessage
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 , Marc Sanchez
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(Id source, int type)
          Builds a new Message with the specified source Node origNode and specified type type
DHTMessage(Id source, int type, java.lang.String key, java.lang.String value)
           
DHTMessage(Id source, int type, java.lang.String key, java.lang.String value, java.util.Vector MultiValue)
          Builds a new Message with the specified source Node and type, key/value pairs.
DHTMessage(Id source, int type, java.lang.String key, java.util.Vector MultiValue)
           
 
Method Summary
 java.lang.String getKey()
           
 Id getSource()
           
 int getType()
           
 java.lang.String getValue()
           
 java.util.Vector getVectorValue()
           
 void setSource(Id source)
           
 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(Id source,
                  int type)
Builds a new Message with the specified source Node origNode and specified type type

Parameters:
source - The source node where a remote or local application launched an INSERT/LOOKUP operation.
type - Type of DHT operation: INSERT/LOOKUP.

DHTMessage

public DHTMessage(Id source,
                  int type,
                  java.lang.String key,
                  java.lang.String value,
                  java.util.Vector MultiValue)
Builds a new Message with the specified source Node and type, key/value pairs.

Parameters:
source - The source node where a remote or local application launched an INSERT/LOOKUP operation.
type - Type of DHT operation: INSERT/LOOKUP
key - Key of the pair.
value - Value of the pair.
MultiValue - List of hash collision for the same key stored on the same node's DHT repository.

DHTMessage

public DHTMessage(Id source,
                  int type,
                  java.lang.String key,
                  java.lang.String value)

DHTMessage

public DHTMessage(Id source,
                  int type,
                  java.lang.String key,
                  java.util.Vector MultiValue)
Method Detail

getSource

public Id getSource()

setSource

public void setSource(Id source)

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()
Overrides:
toString in class java.lang.Object