Next: Server Connection
Up: Client
Previous: GUI
  Contents
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:
- Login Button.
- Send Message Button.
- Add Contact.
- Remove Contact.
A typical state has the following structure:
- Constructor
Send/Receives some message.
Starts/Stops the listening thread.
Disables/Enables Controls.
- Method Overrides
The different methods responsible for events to reflect
correct behavior (e.g. in the functional state the Send Message Button
Event Handler will actually send the message to the CSICQ server).
State Descriptions:
- 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.
- 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.
- 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.
- 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.
- 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: Server Connection
Up: Client
Previous: GUI
  Contents
Zvika Brakerski
2001-05-09