FTManagement.idl

//Background of the project:
//Assumptions:
//1. FTManagementModule runs on a sacred machine
module FTManagementModule {
  typedef long SERVERID;
  const long  SERVER_ALIVE=1;
  const long  SERVER_DOWN=2;
  exception invalid_event{};
  //Category: Fault Tolerance
  //Behavior: Monitor all TrafficControlServer's status 
  //Inherits from: NONE
  //Clients:  Executive,Client
  interface ReplicationManagerInterface {
    //Category: Fault Tolerance
    //Behavior: This funciton will be called by Executive whenever Excutive
    //          detected the TrafficControlServer crashed.
    //Parameters: server id, and what happens
    //Return Value: true or false
    //Exceptions: invalid_event
    //Clients: Executive
    boolean    EventNotify(in long serverid, in long event)
               raises (invalid_event);
    //Category: Fault Tolerance
    //Behavior: return the current primary server
    //Parameters: none
    //Return Value: the primary server name; "" means currently there is no primary
    //Exceptions: invalid_event
    //Clients: Client
    string    GetPrimaryServer();
  };
 
 interface ExecutiveInterface {
    //Category: Fault Tolerance
    //Behavior: always return true when called
    //Parameters: none
    //Return Value: true
    //Exceptions: none
    //Clients: ReplicaitonManager
    boolean    is_alive();
    //Category: Fault Tolerance
    //Behavior: load all states from database
    //Parameters: none
    //Return Value: true if all states are loaded successfully
    //Exceptions: none
    //Clients: ReplicaitonManager    
    boolean    become_primary();
  };
};
 
 
 

FTManagement.idl