AdventNet Web NMS 4 API Specification

Package com.adventnet.nms.failover

 This package contains java documentation for the API classes that provide useful information about the status of the client when it detects connection loss with the front end server.

See:
          Description

Interface Summary
FailOverListener This interface can be used to get the notification of FailOver Event.
 

Class Summary
FailOverEvent  
 

Package com.adventnet.nms.failover Description

 This package contains java documentation for the API classes that provide useful information about the status of the client when it detects connection loss with the front end server. FailOver mechanism is supported only for Application clients and not for the Applet clients(due to Applet restrictions) .i.e the clients which are connected through the Browser.

Actually, the client frame work maintains the number of front-end servers which are connected to a common back-end server. Whenever the
client framework detects connection loss with the front-end server, it intimates the failover listener via the preFailOverNotification( ) method. The FailOverEvent which is passed as an argument to the preFailOverNotification( ) contains information regarding the presently connected front-end server name, port and so on.

FailOver Registeration Process :

 Suppose an application wants to do some operation when the client is trying to do a failOver operation. Here the application must implement the FailOverListener interface and register with the PureClientUtils through the addFailOverListener() method. If an application is an instance of SocketListener then it will automatically get registered with the PureClientUtils on invoking the registerForResponse() method.

For registering as a FailOver Listener, the application needs to specify a constant called SOCKET_TYPE. The client framework sends a failover notification based on the socket type which is specified by the application.

There are three types of constants as given below.

The client framework has two kinds of sockets for communicating with the NMS server. One is the MainSocketClient and the other is the GenericSocketClient . If the application specifies the socket type as PureClientUtils. MAIN_SOCKET , then it  gets the failover notification only when the failoure occurs between the MainSocket client and the NMS server. If the socket type is PureClientUtils.GENERIC_SOCKET, then it gets the failover notification only  when the failoure occurs between the the GenericSocket client and the NMS server. If the socket type is PureClientUtils.GENERAL, then it gets the failover notification when the failoure occurs between the GenericSocket Client or the MainSocket Client and the NMS server.

The following code snippet will help you to achieve the same.

//Registering as FailOver Listener
 
PureClientUtils.addFailOverListener(this, PureClientUtils.MAIN_SOCKET);

FailOver deRegisteration Process :

This mechanism is for disabling the notification mechanism for an application at run time. If this mechanism is used, the client is deregistered for receiving notifications during failover..

The following code snippet shows how you can use the de-registering process.

 //Removes a FailOver Listener from the Client Framework.
 
 PureClientUtils.removeFailOverListener(FailOverListener listener,PureClientUtils.MAIN_SOCKET) ;

While invoking the removeFailOverListener( ) method, make sure that the specified socket type is same as the socket type which was specified while doing the registeration. If an application is an instance of the SocketListener then this deregisteration process will automatically be carried out while shutting down the client.

The client modules which desire to receive PreFailOverNotification and PostFailOverNotification must register themselves as FailOverListeners. For registering as listeners, the modules must implement the FailOverListener interface.

The client framework tries to reestablish the connection with the front end servers which are available for connect. Once the above mentioned operation is over, the client framework intimates the failover listeners about the result of the failover operation through the postFailOverNotification( ) method. The FailOverEvent which is passed as an argument to the preFailOverNotification( ) contains information regarding the presently connected front-end server name, port and so on.
 
 
 
 


AdventNet Web NMS 4 API Specification