sg.edu.nus.protocol.body
Class SPJoinForcedBody

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

public class SPJoinForcedBody
extends Body
implements java.io.Serializable

Implement the message body used for forcing a super peer node joins as a child of another super peer node. This protocol is only used during network restructuring process

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

Constructor Summary
SPJoinForcedBody(PhysicalInfo physicalSender, boolean direction, LogicalInfo logicalDestination)
          Construct the message body with the specified parameters.
SPJoinForcedBody(java.lang.String serializeData)
          Construct the message body with a string value.
 
Method Summary
 boolean getDirection()
          Get direction
 LogicalInfo getLogicalDestination()
          Get logical address of the receiver
 PhysicalInfo getPhysicalSender()
          Get physical address of the sender
 java.lang.String getString()
          Return a readable string for testing or writing in the log file
 void setLogicalDestination(LogicalInfo logicalDestination)
          Update logical address of the receiver
 void setPhysicalSender(PhysicalInfo physicalSender)
          Update physical address of the sender
 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

SPJoinForcedBody

public SPJoinForcedBody(PhysicalInfo physicalSender,
                        boolean direction,
                        LogicalInfo logicalDestination)
Construct the message body with the specified parameters.

Parameters:
physicalSender - physical address of the sender
direction - true: node is forced to join as a right child of another node, false: node is forced to join as a left child
logicalDestination - logical address of the receiver

SPJoinForcedBody

public SPJoinForcedBody(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

setPhysicalSender

public void setPhysicalSender(PhysicalInfo physicalSender)
Update physical address of the sender

Parameters:
physicalSender - physical address of the sender

getPhysicalSender

public PhysicalInfo getPhysicalSender()
Get physical address of the sender

Returns:
physical address of the sender

getDirection

public boolean getDirection()
Get direction

Returns:
direction

setLogicalDestination

public void setLogicalDestination(LogicalInfo logicalDestination)
Update logical address of the receiver

Parameters:
logicalDestination - logical address of the receiver

getLogicalDestination

public LogicalInfo getLogicalDestination()
Get logical address of the receiver

Returns:
logical address of the receiver

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