/** * LOCAL INTERFACES FOR APPLICATION DEVELOPERS */ /** * ServerManager interface * This local interface lets the application manage ServerGroup registration; * de-registration and notify the FT infrastructure of its readiness to receive * requests. * * Compliant ORBs / FT implementations should make this available to the * application developer by ORB::resolve_initial_references ("FTServerManager"). */ local interface ServerManager { /** * This value will default to -ORBFTLocation if specified * (Attempting to set a -ORBFTLocation value on subsequent ORB * initialisations is a user error and behaviour is undefined). */ attribute Location the_location; // Check IDL3 attribute exceptions ... /** * This call prompts the registration of the server with the * LWFT ServerGroupManager */ void register_server (); /** * This call will notify the LWFT ServerGroupManager that * this server is now fully initialised and ready to receive requests. */ void server_ready (); /** * The application may call this to prompt the call * to unregister_server ServerGroupManager. */ void unregister_server (); }; /** * RecoveryObserver interface * Observer interface for being notified whenever recovery is in progress * in the case of primary/backup passive replication, .i.e., a backup is * being promoted to become a primary. */ local interface RecoveryObserver { /** * Instructs the backup replica that recovery is starting. */ void on_recovery(); }; /** * ************************************************************************** * Server Replica Readiness Status * ************************************************************************** */ typedef long ServerStatusValue; const ServerStatusValue SRV_STATUS_UNKNOWN = 0; /** * The server process is performing its recovery/initialisation to get ready * to service request in case of a primary service, or else to become ready * to take over should the primary fail in case of a backup server. * It is not yet ready to service requests so the FT-enabled middleware * will not deliver to it group requests. * Non-group requests such as administartive requests will however be delivered * to the server in order to allow it to perform any required initialisations. */ const ServerStatusValue SRV_STATUS_RECOVERING = 1; /** * The server process has now completed its recovery and it is ready * to service request in case of a primary service, or else to become ready * to take over should the primary fail in case of a backup server. */ const ServerStatusValue SRV_STATUS_READY = 2; /** * ************************************************************************** * Server Replica Replication Role * ************************************************************************** */ typedef long ServerReplicationRoleValue; const ServerReplicationRoleValue SRV_REPL_UNKNOWN = 0; /** * The server process is either primary or recovering to become a primary. * Once its status has become ready, the server will be serviong group requests. */ const ServerReplicationRoleValue SRV_REPL_PRIMARY = 1; /** * The server process is either backup or recovering to become a backup. * Once its status has become ready, the server will be eligible to be become * a primary once current primary server fails. */ const ServerReplicationRoleValue SRV_REPL_BACKUP = 2; /** * In the case of active replication, the server has an active role and will * be allowed to service service requests once its status becomes ready. */ const ServerReplicationRoleValue SRV_REPL_ACTIVE = 3; /** * ServerRecoveryManager */ local interface ServerRecoveryManager : ServerManager { boolean register_recovery_observer (in RecoveryObserver rec); boolean unregister_recovery_observer (in RecoveryObserver rec); readonly attribute ServerStatusValue replica_status; readonly attribute ServerReplicationRoleValue replica_role; }; /** * REMOTE INTERFACES FOR FT INFRASTRUCTURE/MIDDLEWARE */ /** * The ServerCallback interface is the base for specific callback specialisations. * * See ServerGroupManager::register_server * A ServerCallback object can be registered on this call. The infrastructure * can narrow it to specific subcategories */ interface ServerCallback {}; /** * */ exception ServerGroupNotFound {}; /** * */ exception ServerNotFound {}; /** * Operation incompatible with current server status. */ exception WrongStatus {}; /** * */ exception AlreadyRegistered {}; /** * */ exception UnsupportedCallback {}; /** * Compliant FT implementations should register an instance to be accessible to * the server ORB via ::resolve_initial_references ("FTServerGroupManager"). */ interface ServerGroupManager { /** * * @param the_location The location of the server replica. It is expected * that the location will contain host and server or server * identification. * If (and only if) the server provides an empty name then the * infrastructure could provide a value. * @param server_id The identifier of the Server group. It is expected to * contain -ORBServerId value for ORB_init. * @param callback object that the infrastructure can call back * upon to obtain information about the server or to manage the * server status / role etc... * * @exception ServerGroupNotFound raised when server_id does not denote an * existing server group. * @exception AlreadyRegistered raised when the_location has already been * registered. */ void register_server(inout Location the_location, // Host, FTLocation in ServerId the_server_id, // -ORBServerId in Properties props, in ServerCallback callback) raises (ServerGroupNotFound, AlreadyRegistered, UnsupportedCallback); /** * @param the_location The location of the server that is to be unregistered. * * @exception ServerNotFound raised when the_location does not denote an * already registered server. */ void unregister_server(in Location the_location) raises (ServerNotFound); /** * * @param the_location * * @exception ServerNotFound raised when the_location does not denote an * already registered server. * @exception WrongStatus raised when the server is not in a status that * is not expecting a call to server_ready operation. */ void server_ready(in Location the_location) raises (ServerNotFound, WrongStatus); }; /** * ServerGroupObserver interface */ interface ServerGroupObserver { void on_register_server (in Location the_location, // Host, FTLocation in ServerId the_server_id, // -ORBServerId in Properties props, in ServerCallback callback); void on_unregister_server (in Location the_location); void on_server_ready (in Location the_location); }; /** * ServerGroupManagerExt interface */ interface ServerGroupManagerExt : ServerGroupManager { /** * Empty sequence means all */ void register_observer (in ServerIdSeq server_groups, // ServerGroups in ServerGroupObserver obs); void unregister_observer (in ServerIdSeq server_groups); }; /** * ServerGroupMember */ struct ServerGroupMember { Location server_location; ServerCallback server_callback; Properties props; }; typedef sequence ServerGroupMembers; interface GroupUpdateObserver : ServerCallback { void on_update_group(in ServerGroupMembers members); }; /** * Server Recovery * * RecoverableServer interface * Observer interface for being notified whenever recovery is in progress * in the case of primary/backup passive replication, .i.e., a backup is * being promoted to become a primary. */ interface RecoverableServer : ServerCallback { /** * Instructs the backup replica that recovery is starting. * The infrastructure can call this method to notify the server that * it should perform the actions needed to make it ready to accept request * as a primary, for example. When the server is ready to accept requests * it should signal the infrastructure by calling ServerManager::server_ready. */ void start_recovery(in Properties props); };