uk.ac.ic.doc.automed.p2p.state
Class DHTRoutingState

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.state.PeerStateHandler
      extended by uk.ac.ic.doc.automed.p2p.state.DHTRoutingState

public class DHTRoutingState
extends PeerStateHandler


Field Summary
static int STATE_JOINED_BUT_UNSTABLISED
          joined but stabliser has not been run
static int STATE_JOINED_COMPLETE
          joined and stabliser has completed its (first) run
 
Fields inherited from class uk.ac.ic.doc.automed.p2p.state.PeerStateHandler
_currentState, STATE_HELLO_COMPLETE, STATE_HELLO_INIT, STATE_INIT, STATE_JOINED_GLOBAL, STATE_JOINED_LOCAL, STATE_REGISTER_GLOBAL, STATE_STAND_ALONE
 
Constructor Summary
DHTRoutingState()
           
 
Method Summary
 void changePeerState(int newState)
          It handle all state transitions in one method, throwing exceptions when
conflicts occur
.
 
Methods inherited from class uk.ac.ic.doc.automed.p2p.state.PeerStateHandler
addListener, getPeerState, notifyListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_JOINED_BUT_UNSTABLISED

public static final int STATE_JOINED_BUT_UNSTABLISED
joined but stabliser has not been run

See Also:
Constant Field Values

STATE_JOINED_COMPLETE

public static final int STATE_JOINED_COMPLETE
joined and stabliser has completed its (first) run

See Also:
Constant Field Values
Constructor Detail

DHTRoutingState

public DHTRoutingState()
Method Detail

changePeerState

public void changePeerState(int newState)
                     throws StateChangedException

It handle all state transitions in one method, throwing exceptions when
conflicts occur
. This method is synchronized to make sure that peer's states are updated
in order.

Overrides:
changePeerState in class PeerStateHandler
Throws:
StateChangedException