hypercast
Class MessageStoreFSM_Sync

java.lang.Object
  |
  +--hypercast.I_MessageStoreFSM
        |
        +--hypercast.MessageStoreFSM_Sync

public class MessageStoreFSM_Sync
extends I_MessageStoreFSM

This class is a finite state machine which handles synchronization.


Field Summary
static byte DONT_HAVE_IT
           
static byte HAVE_IT
           
static byte HavePayload
          The state of the message,have payload
static byte Init
          The state of the message,Init
static byte NACK_SYNC
           
static byte NoPayload_NoRecover
          The state of the message,Don't have payload and don't recover
static byte NoPayload_Recover
          The state of the message,Don't have payload and try to recover
static byte PAYLOAD
          ADF_Payload for Synchronization
static byte QUERY_MSG_SYNC
           
static byte QUERY_SYNC_ALL
          ADF_Control Types for Syncronization
static byte WaitforPayload
          The state of the message,Wait for Payload
 
Constructor Summary
MessageStoreFSM_Sync(hypercast.OL_Socket socket, hypercast.MessageStore messageStore, hypercast.HyperCastConfig config)
          Constructs a MessageStoreFSM_Sync object with OL_Socket and MessageStore.
 
Method Summary
 void changingNeighbor()
          check the change of the neighborhood
 short getFSMID()
          Get the service number of the finite state machine
 byte[] getID()
          get the message ID
 hypercast.I_LogicalAddress getRoot()
          get the sender's logical address
 byte getState()
          get the state of this finite state machine
 void newACMsg(hypercast.OL_Message msg)
          Process the new ADF_Control message
 void newADMsg(hypercast.OL_Message msg)
          process new ADF_Data message
 void timerExpired(int timerIndex)
          Set the time expired events
 void updateACMsg(hypercast.OL_Message msg)
          Update the new ADF_Control message
 void updateADMsg(hypercast.OL_Message msg)
          Update the known ADF_Data message entry
 
Methods inherited from class hypercast.I_MessageStoreFSM
receiveControlMessage, receiveDataMessage, timerExpired
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAYLOAD

public static final byte PAYLOAD
ADF_Payload for Synchronization

See Also:
Constant Field Values

QUERY_SYNC_ALL

public static final byte QUERY_SYNC_ALL
ADF_Control Types for Syncronization

See Also:
Constant Field Values

QUERY_MSG_SYNC

public static final byte QUERY_MSG_SYNC
See Also:
Constant Field Values

HAVE_IT

public static final byte HAVE_IT
See Also:
Constant Field Values

DONT_HAVE_IT

public static final byte DONT_HAVE_IT
See Also:
Constant Field Values

NACK_SYNC

public static final byte NACK_SYNC
See Also:
Constant Field Values

Init

public static final byte Init
The state of the message,Init

See Also:
Constant Field Values

NoPayload_Recover

public static final byte NoPayload_Recover
The state of the message,Don't have payload and try to recover

See Also:
Constant Field Values

NoPayload_NoRecover

public static final byte NoPayload_NoRecover
The state of the message,Don't have payload and don't recover

See Also:
Constant Field Values

WaitforPayload

public static final byte WaitforPayload
The state of the message,Wait for Payload

See Also:
Constant Field Values

HavePayload

public static final byte HavePayload
The state of the message,have payload

See Also:
Constant Field Values
Constructor Detail

MessageStoreFSM_Sync

public MessageStoreFSM_Sync(hypercast.OL_Socket socket,
                            hypercast.MessageStore messageStore,
                            hypercast.HyperCastConfig config)
Constructs a MessageStoreFSM_Sync object with OL_Socket and MessageStore.

Parameters:
socket - OL_Socket
messageStore - MessageStore
Method Detail

changingNeighbor

public void changingNeighbor()
check the change of the neighborhood

Specified by:
changingNeighbor in class I_MessageStoreFSM

getFSMID

public short getFSMID()
Description copied from class: I_MessageStoreFSM
Get the service number of the finite state machine

Specified by:
getFSMID in class I_MessageStoreFSM
Returns:
the finite state machine id

getID

public byte[] getID()
get the message ID


getState

public byte getState()
get the state of this finite state machine


getRoot

public hypercast.I_LogicalAddress getRoot()
get the sender's logical address


newADMsg

public void newADMsg(hypercast.OL_Message msg)
process new ADF_Data message

Specified by:
newADMsg in class I_MessageStoreFSM
Parameters:
msg - OL_Message

newACMsg

public void newACMsg(hypercast.OL_Message msg)
Process the new ADF_Control message

Specified by:
newACMsg in class I_MessageStoreFSM
Parameters:
msg - OL_Message

updateADMsg

public void updateADMsg(hypercast.OL_Message msg)
Update the known ADF_Data message entry

Specified by:
updateADMsg in class I_MessageStoreFSM
Parameters:
msg - OL_Message

updateACMsg

public void updateACMsg(hypercast.OL_Message msg)
Update the new ADF_Control message

Specified by:
updateACMsg in class I_MessageStoreFSM
Parameters:
msg - OL_Message

timerExpired

public void timerExpired(int timerIndex)
Set the time expired events

Specified by:
timerExpired in class I_MessageStoreFSM
Parameters:
timerIndex -