|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.nms.startclient.MainSocketClient
This class serves as the basic communication endpoint for the Web NMS client. This class handles all the communication done between the Web NMS Client and the Web NMS Server. All the responses from the Web NMS Server are received and processed here. The actual transport of the data (based on the underlying protocol) is taken care by the TransportProvider implementation class.
The communication between the client and server modules are achieved through sessions. The client side sessions classes should implement the interface SocketConnection. The sessions should have a corresponding implementation either in the Front End server or the Back End server of Web NMS for communication.
The client side sessions should register with a unique session id, with this class for communication using the method registerForResponses(). The communication will be routed to the corresponding sessions both on the server and client side based on this unqiue session id, which will distinctly identify the session.
The class implements the Runnable interface as it is started as a thread during client intialization. The users should
note to use only the prescribed methods in this class, as any misuse of the methods might lead to undesirable behaviour
of the client.
This is a client side class and hence can be used only in the JVM as that of the
client.
SocketConnection,
TransportProvider| Field Summary | |
boolean |
connected
The value specifies if the client is connected to the server or not. |
boolean |
isDialogShowing
|
java.lang.String |
licenseAllowed
The value that specifies the license permission string. |
| Constructor Summary | |
MainSocketClient(java.applet.Applet app)
Creates a MainSocketClient with the applet argument. |
|
MainSocketClient(java.applet.Applet app,
java.lang.String className)
Creates the MainSocketClient with the applet and the TransportProvider Class name. |
|
MainSocketClient(java.lang.String hostname,
java.lang.String rmi)
This constructor is used for instantiating the MainSocketclient when the communication protocol is RMI. |
|
| Method Summary | |
boolean |
checkTimeout(java.lang.String reqid,
long timeOut)
Checks whether there are any timed-out requests for this specific ID. |
void |
deRegisterForResponses(java.lang.String id)
|
boolean |
establishConnection(java.applet.Applet app,
java.lang.String className)
|
java.lang.String |
genReqID()
Generate a request ID for PDU. |
java.util.Vector |
getCachedRequests(java.lang.String id)
This method is used to get the cached requests (Requests were received after identifying the connection failure). |
java.lang.StringBuffer |
getLicenseDetails()
|
long |
getTimeOutCount()
This method returns the current timeout interval set for synchronous call to the server. |
boolean |
isConnected()
This method is used to check connection variable of MainSocket |
boolean |
isUserStatusModified()
|
void |
killMeSilently()
Terminates the connection maintained with the server and closes all the resources used up. |
void |
processNmsPDU(byte[] pduData)
Processes the data received from the transport provider. |
void |
processTheCachedRequests()
This method will process the cached requests after the FailOver Operation successfully. |
java.lang.String |
registerForResponses(SocketConnection sockClient,
java.lang.String id)
All clients sessions mplementing the SocketConnection Interface will register for responses here with the session id the client will use for communicating with the server. |
java.util.Vector |
removeCachedRequests(java.lang.String id)
This method is used to remove the cached requests (Requests were received after identifying the connection failure). |
void |
run()
Implementation of the Runnable interface. |
boolean |
send(java.lang.String id,
byte[] data)
This method sends the data asynchronously to the Server.ie., this method returns immediately after placing the request in a request queue. |
void |
sendInitialFERequests(boolean f)
|
void |
setCachingState(boolean state)
This method will enable the caching flag |
void |
setClientFrameWorkAPI(ClientFrameWorkAPI cfwAPI)
This method sets the ClientFrameWorkAPI instance. |
void |
setTimeOutCount(long milliSeconds)
This method sets the timeOutCount for Synchronized send to the Server. |
void |
showCloseDialog()
This method just pops-up a dialog saying that the connection to the NMS server is lost and gets out. |
void |
showCustomizedServerClosedDialog(javax.swing.JOptionPane optionPane,
java.lang.String strOptionPaneTitle)
This method is used to cutomize the title and the JOptionPane of the "Connection lost" dialog. |
byte[] |
syncSend(java.lang.String id,
byte[] data)
Sends the data to the server and returns only after a response is received for this particular request i.e., the data is transferred synchronously. |
byte[] |
syncSend(java.lang.String id,
byte[] data,
long timeOut)
Sends the data to the server and returns only after a response is received for this particular request i.e., the data is transferred synchronously. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean connected
public java.lang.String licenseAllowed
public boolean isDialogShowing
| Constructor Detail |
public MainSocketClient(java.applet.Applet app)
app - The Web NMS Applet reference, which should contain the CLIENT_CLASS_NAME applet parameter for
initializing the transport provider.
public MainSocketClient(java.applet.Applet app,
java.lang.String className)
app - the Web NMS Client applet.className - The implementation classname of the TransportProvider interface
public MainSocketClient(java.lang.String hostname,
java.lang.String rmi)
throws java.lang.Exception
hostname - The hostname of the Web NMS Front end server to which the client should connectrmi - The string is presently not used for any purpose. Reserved for future use.java.lang.Exception - | Method Detail |
public boolean establishConnection(java.applet.Applet app,
java.lang.String className)
public void run()
run in interface java.lang.Runnablepublic void sendInitialFERequests(boolean f)
public java.lang.StringBuffer getLicenseDetails()
public void showCloseDialog()
public void processNmsPDU(byte[] pduData)
pduData - The byte arragy to be processed.public boolean isUserStatusModified()
public java.lang.String registerForResponses(SocketConnection sockClient,
java.lang.String id)
sockClient - the client session registering for the response.id - the unique ID to be used for the communication with the server.public void deRegisterForResponses(java.lang.String id)
public boolean send(java.lang.String id,
byte[] data)
id - the registered session id.data - the data to be sent to the server.
public byte[] syncSend(java.lang.String id,
byte[] data)
id - the registered session ID.data - the data that needs to be sent.
public byte[] syncSend(java.lang.String id,
byte[] data,
long timeOut)
id - the registered session ID.data - the data that needs to be sent.timeout - the max time in milliseconds for which the request will wait for response.
public boolean checkTimeout(java.lang.String reqid,
long timeOut)
reqid - the request ID for which the time out request is to be verified.public java.lang.String genReqID()
public void killMeSilently()
public void setTimeOutCount(long milliSeconds)
milliSeconds - The time out count to be set for synchronized calls to the server.getTimeOutCount()public long getTimeOutCount()
setTimeOutCount(long)public boolean isConnected()
public void setCachingState(boolean state)
public void processTheCachedRequests()
public java.util.Vector getCachedRequests(java.lang.String id)
public java.util.Vector removeCachedRequests(java.lang.String id)
public void setClientFrameWorkAPI(ClientFrameWorkAPI cfwAPI)
cfwAPI - instance of ClienFrameWorkAPI
public void showCustomizedServerClosedDialog(javax.swing.JOptionPane optionPane,
java.lang.String strOptionPaneTitle)
optionPane - JOptionPane with cutomized buttons and MessagesstrOptionPaneTitle - title for the "Connection lost" dialog.
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||