01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.l2.state;
06:
07: import com.tc.l2.context.StateChangedEvent;
08: import com.tc.l2.msg.L2StateMessage;
09: import com.tc.net.groups.GroupException;
10: import com.tc.net.groups.NodeID;
11: import com.tc.util.State;
12:
13: public interface StateManager {
14:
15: public static final State ACTIVE_COORDINATOR = new State(
16: "ACTIVE-COORDINATOR");
17: public static final State PASSIVE_UNINTIALIZED = new State(
18: "PASSIVE-UNINITIALIZED");
19: public static final State PASSIVE_STANDBY = new State(
20: "PASSIVE-STANDBY");
21: public static final State START_STATE = new State("START-STATE");
22: public static final State STOP_STATE = new State("STOP-STATE");
23: public static final State[] validStates = new State[] {
24: START_STATE, PASSIVE_UNINTIALIZED, PASSIVE_STANDBY,
25: ACTIVE_COORDINATOR, STOP_STATE };
26:
27: public void startElection();
28:
29: public void startElectionIfNecessary(NodeID disconnectedNode);
30:
31: public void registerForStateChangeEvents(
32: StateChangeListener listener);
33:
34: public void fireStateChangedEvent(StateChangedEvent sce);
35:
36: public boolean isActiveCoordinator();
37:
38: public void moveNodeToPassiveStandby(NodeID nodeID);
39:
40: public void moveToPassiveStandbyState();
41:
42: public void publishActiveState(NodeID nodeID) throws GroupException;
43:
44: public void handleClusterStateMessage(L2StateMessage clusterMsg);
45:
46: public NodeID getActiveNodeID();
47:
48: }
|