rice.pastry.socket
Class HelloMessage

java.lang.Object
  |
  +--rice.pastry.wire.messaging.socket.SocketMessage
        |
        +--rice.pastry.wire.messaging.socket.SocketCommandMessage
              |
              +--rice.pastry.socket.HelloMessage
All Implemented Interfaces:
java.io.Serializable

public class HelloMessage
extends rice.pastry.wire.messaging.socket.SocketCommandMessage

Class which represents a greeting in the socket-based pastry protocol. It contains the InetSocketAddress and nodeId of the socket-initiating node.

Version:
$Id: HelloMessage.java,v 1.2 2003/09/22 19:53:05 glchen Exp $
Author:
Guanling Chen, Alan Mislove
See Also:
Serialized Form

Field Summary
private  java.net.InetSocketAddress address
           
private  rice.pastry.NodeId dest
           
private  rice.pastry.NodeId nodeId
           
 
Constructor Summary
HelloMessage(SocketPastryNode pn, rice.pastry.NodeId dest)
          Constructor
 
Method Summary
 java.net.InetSocketAddress getAddress()
          Returns the address of the source of this message.
 rice.pastry.NodeId getDestination()
          Returns the NodeId of the source
 rice.pastry.NodeId getNodeId()
          Returns the NodeId of the source
 HelloResponseMessage getResponse(SocketPastryNode pn)
          Returns the appropriate response for this HelloMessage
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

private java.net.InetSocketAddress address

nodeId

private rice.pastry.NodeId nodeId

dest

private rice.pastry.NodeId dest
Constructor Detail

HelloMessage

public HelloMessage(SocketPastryNode pn,
                    rice.pastry.NodeId dest)
Constructor

Method Detail

getAddress

public java.net.InetSocketAddress getAddress()
Returns the address of the source of this message.

Returns:
The address of the source of the message.

getNodeId

public rice.pastry.NodeId getNodeId()
Returns the NodeId of the source

Returns:
The NodeId of the source of this message.

getDestination

public rice.pastry.NodeId getDestination()
Returns the NodeId of the source

Returns:
The NodeId of the source of this message.

getResponse

public HelloResponseMessage getResponse(SocketPastryNode pn)
Returns the appropriate response for this HelloMessage

Parameters:
pn - The local pastry node
Returns:
A response message that should be sent to sender

toString

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