Products | Versions |
---|---|
TIBCO Enterprise Message Service | - |
Not Applicable | - |
How to obtain the status of an EMS appliance instance or software EMS version 8.1.0 onwards using EMS Admin API,
EMS 8.1 introduce a new EMS Admin API to accommodate all of the states of EMS appliance, along with the standard active/standby state in the software based fault tolerant setup. Specifically, you can get the state of a EMS 8.1 (and greater) server, whether it is EMS software or an EMS instance running inside the appliance using the following API.
Tibjmsadmin admin = new TibjmsAdmin(url,"admin","<admin_password>");
State state = admin.getStateInfo().getState();
If you would like to get a string representation of the server status, use state.toString(). Alternatively, you can retrieve the integer value of the state by calling state.get():
--------------------------------------------------------------------------
public int get()
Get the current state of the server.
In classic FT mode, can return one of the constants:
SERVER_STATE_STANDBY - standby server
SERVER_STATE_ACTIVE - active server
In the EMS Appliance, can return one of the above two constants, augmented with complementary flags:
SERVER_COMPSTATE_WAIT_FOR_PEER - the server is waiting for its peer to come up
SERVER_COMPSTATE_SYNCHRONIZING - the server is synchronizing with its peer
SERVER_COMPSTATE_REPLICATING - the server is replicating with its peer
SERVER_COMPSTATE_PAUSED - the server is paused
SERVER_COMPSTATE_STANDALONE - the server is running standalone
In addition to the two server states repeated below, the following state values are provided as a convenience that can be used instead of checking against individual flags:
SERVER_STATE_STANDBY - standby server
SERVER_STATE_ACTIVE - active server
SERVER_STATE_WAIT_FOR_PEER - server waiting for its peer to come up
SERVER_STATE_STANDBY_SYNCHRONIZING - standby server synchronizing
SERVER_STATE_STANDBY_REPLICATING - standby server replicating
SERVER_STATE_STANDBY_PAUSED - standby server paused
SERVER_STATE_ACTIVE_SYNCHRONIZING - active server synchronizing
SERVER_STATE_ACTIVE_REPLICATING - active server replicating
SERVER_STATE_ACTIVE_PAUSED - active server paused
SERVER_STATE_ACTIVE_STANDALONE - standalone active server
--------------------------------------------------------------------------
You can then compare the integer value with each of the convenient state values to interpret the actual status.