viceroy.net
Class JoinLeaveDataMessage

java.lang.Object
  |
  +--viceroy.net.JoinLeaveDataMessage
All Implemented Interfaces:
Message
Direct Known Subclasses:
JoinDataMessage, LeaveDataMessage

public abstract class JoinLeaveDataMessage
extends java.lang.Object
implements Message

A 'new peer data' message. represents a message that contains all the data that is relevant for a joining or leaving peer

Author:
Anat Talmy
, Oren Dobzinski

Field Summary
private  ViceroyPeer predecessor
          the predecessor
private  ViceroyPeer successor
          the successor
private  java.util.SortedMap values
          the values to be taken over
 
Constructor Summary
JoinLeaveDataMessage(ViceroyPeer pred, ViceroyPeer succ, java.util.SortedMap val)
          creates a new message
 
Method Summary
 ViceroyPeer getPredecessor()
          gets the predecessor viceroy peer
 ViceroyPeer getSuccessor()
          gets the successor viceroy peer
 java.util.SortedMap getValues()
          gets the values stored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface viceroy.net.Message
getType
 

Field Detail

values

private java.util.SortedMap values
the values to be taken over


predecessor

private ViceroyPeer predecessor
the predecessor


successor

private ViceroyPeer successor
the successor

Constructor Detail

JoinLeaveDataMessage

public JoinLeaveDataMessage(ViceroyPeer pred,
                            ViceroyPeer succ,
                            java.util.SortedMap val)
creates a new message

Parameters:
pred - the predecessor of the joining peer
succ - the successor of the joining peer
val - the new values of the joining peer
Method Detail

getValues

public java.util.SortedMap getValues()
gets the values stored

Returns:
the value that was looked up

getSuccessor

public ViceroyPeer getSuccessor()
gets the successor viceroy peer

Returns:
the successor viceroy peer

getPredecessor

public ViceroyPeer getPredecessor()
gets the predecessor viceroy peer

Returns:
the predecessor viceroy peer