sg.edu.nus.protocol.body
Class SPLeaveNotifyBody

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

public class SPLeaveNotifyBody
extends Body
implements java.io.Serializable

Implement the message body used for notify all nodes except the parent when a node leaves the network

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

Constructor Summary
SPLeaveNotifyBody(PhysicalInfo physicalSender, LogicalInfo logicalSender, PhysicalInfo physicalReplacer, int position, int index, LogicalInfo logicalDestination)
          Construct the message body with specified parameters.
SPLeaveNotifyBody(java.lang.String serializeData)
          Construct the message body with a string value.
 
Method Summary
 int getIndex()
          Get the index of the departure node inside the routing table
 LogicalInfo getLogicalDestination()
          Get logical address of the receiver
 LogicalInfo getLogicalSender()
          Get logical address of the sender
 PhysicalInfo getPhysicalReplacer()
          Get physical address of the replacer
 PhysicalInfo getPhysicalSender()
          Get physical address of the sender
 int getPosition()
          Get the position of the departure node
 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

SPLeaveNotifyBody

public SPLeaveNotifyBody(PhysicalInfo physicalSender,
                         LogicalInfo logicalSender,
                         PhysicalInfo physicalReplacer,
                         int position,
                         int index,
                         LogicalInfo logicalDestination)
Construct the message body with specified parameters.

Parameters:
physicalSender - physical address of the sender
logicalSender - logical address of the sender
physicalReplacer - physical address of the replacer
position - position of the departure node 0: departure node is the parent of the receiver node 1: departure node is the left adjacent of the receiver node 2: departure node is the right adjacent of the receiver node 3: departure node is the left neighbor of the receiver node 4: departure node is the right neighbor of the receiver node
index - having meaning on if position is 1 or 2: the index of the departure node inside the routing table
logicalDestination - logical address of the receiver

SPLeaveNotifyBody

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

getPhysicalReplacer

public PhysicalInfo getPhysicalReplacer()
Get physical address of the replacer

Returns:
tree node

getPosition

public int getPosition()
Get the position of the departure node

Returns:
position of the departure node

getIndex

public int getIndex()
Get the index of the departure node inside the routing table

Returns:
index of the departure node

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