sg.edu.nus.protocol.body
Class SPJoinAcceptBody

java.lang.Object
  extended by sg.edu.nus.protocol.body.Body
      extended by sg.edu.nus.protocol.body.SPJoinAcceptBody
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SPJoinAcceptBody
extends Body
implements java.io.Serializable

Implement the message body used for sending acceptance to a new super peer

Version:
1.0 2006-2-22
Author:
Vu Quang Hieu
See Also:
Serialized Form

Constructor Summary
SPJoinAcceptBody(PhysicalInfo physicalSender, LogicalInfo logicalSender, LogicalInfo newNodePosition, AdjacentNodeInfo leftAdjacent, AdjacentNodeInfo rightAdjacent, ContentInfo content, int numOfExpectedRTReply, boolean isFake, boolean direction)
          Construct the message body with specified parameters.
SPJoinAcceptBody(java.lang.String serializeData)
          Construct the message body with a string value.
 
Method Summary
 ContentInfo getContent()
          Get range of values and data the new peer is in charge
 boolean getDirection()
          Get direction for transfer the fake node.
 boolean getIsFake()
          Get type of the new node
 AdjacentNodeInfo getLeftAdjacent()
          Get information of the new node's left adjacent
 LogicalInfo getLogicalSender()
          Get logical address of the sender
 LogicalInfo getNewNodePosition()
          Get logical address of the new node
 int getNumOfExpectedRTReply()
          Get number of expected routing table reply from new peer's neighbor nodes
 PhysicalInfo getPhysicalSender()
          Get physical address of the sender
 AdjacentNodeInfo getRightAdjacent()
          Get information of the new node's right adjacent
 java.lang.String getString()
          Return a readable string for testing or writing in the log file
 java.lang.String toString()
           
 
Methods inherited from class sg.edu.nus.protocol.body.Body
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPJoinAcceptBody

public SPJoinAcceptBody(PhysicalInfo physicalSender,
                        LogicalInfo logicalSender,
                        LogicalInfo newNodePosition,
                        AdjacentNodeInfo leftAdjacent,
                        AdjacentNodeInfo rightAdjacent,
                        ContentInfo content,
                        int numOfExpectedRTReply,
                        boolean isFake,
                        boolean direction)
Construct the message body with specified parameters.

Parameters:
physicalSender - physical address of the sender
logicalSender - logical address of the sender
newNodePosition - logical address of the new peer
leftAdjacent - information of the new peer's left adjacent
rightAdjacent - information of the new peer's right adjacent
content - range of values and data the new peer is in charge
numOfExpectedRTReply - number of expected routing table reply from new peer's neighbor nodes
isFake - true: the new node is a fake node, which is created for network restructuring purpose and will be transfered to another node, false: the new node is a real new joining node
direction - if the node is a fake node, it will be transfered towards the direction: true to the right, false to the left

SPJoinAcceptBody

public SPJoinAcceptBody(java.lang.String serializeData)
Construct the message body with a string value.

Parameters:
serializeData - the string value that contains the serialized message body
Method Detail

getPhysicalSender

public PhysicalInfo getPhysicalSender()
Get physical address of the sender

Returns:
physical address of the sender

getLogicalSender

public LogicalInfo getLogicalSender()
Get logical address of the sender

Returns:
logical address of the sender

getNewNodePosition

public LogicalInfo getNewNodePosition()
Get logical address of the new node

Returns:
logical address of the new node

getLeftAdjacent

public AdjacentNodeInfo getLeftAdjacent()
Get information of the new node's left adjacent

Returns:
information of the new node's left adjacent

getRightAdjacent

public AdjacentNodeInfo getRightAdjacent()
Get information of the new node's right adjacent

Returns:
information of the new node's right adjacent

getContent

public ContentInfo getContent()
Get range of values and data the new peer is in charge

Returns:
content information

getNumOfExpectedRTReply

public int getNumOfExpectedRTReply()
Get number of expected routing table reply from new peer's neighbor nodes

Returns:
number of expected routing table reply from new peer's neighbor nodes

getIsFake

public boolean getIsFake()
Get type of the new node

Returns:
type of the new node: true it is a fake node, false it is a real node

getDirection

public boolean getDirection()
Get direction for transfer the fake node. It only has meaning if the node is a fake node

Returns:
direction for transfer the fake node

getString

public java.lang.String getString()
Return a readable string for testing or writing in the log file

Returns:
a readable string

toString

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