next up previous contents
Next: Server Connection Up: Client Previous: GUI   Contents

State

State defines the current behavior and functionality of the Applet. State changes according to local user actions and according to remote events or messages received. the State class controls the behavior of the following buttons:

A typical state has the following structure:

State Descriptions:

  1. Initialized:
    This is the initial state of the applet after being loaded. At this point, the applets presents all GUI elements disabled and tries to connect to CSICQ server.

    If the connection has been established correctly, the state is changed to login. In case an error occured (could not get socket or failed to connect to the server) the state is changed to Disconnected.

  2. login:
    in this state, the login frame is activated and the user is prompted to enter their ICQ UIN, nickname and password. After the user has pressed login button, the applet sends a login request to the server and waits for the server to respond. If a ``login successful'' message is received from server, the applet state is changed to Get Contact List. Three unsuccessful login attempts change the state of the applet to Disconnected.

  3. Functional:
    This is the fully functional state of the applet. In this state, all GUI objects are activated. They function as described in the GUI section. A thread is activated to listen to incoming events from the server.

  4. Temporary Disconnected:
    This state is entered upon receiving an ``Inform Disconnected'' message from the server. The listening thread is not stopped. All GUI elements are disabled . The Applet is waiting for a ``Login Successful'' message and then it returns to the Functional state.

  5. Disconnected:
    This state is entered upon a failure in the TCP socket connected to the server or upon closure of the applet. The listening thread is stopped (if activated), all GUI elements are disabled and all resources are freed. The Applet is ready to be closed.


next up previous contents
Next: Server Connection Up: Client Previous: GUI   Contents
Zvika Brakerski 2001-05-09