ch.epfl.lpd.ids.client
Interface IChatClient

All Known Implementing Classes:
ChatClient

public interface IChatClient

Specification of a chat client. This makes the interface between a ClientGUI and ChatClient and let the ClientGUI being independant on the ChatClient implementation. A chat client should be able to connect/disconnect from the server, send message and dispose all the ressources that are associated to it.

Author:
Sebastien Baehni

Method Summary
 void close()
          Method called when the client wants to release all the ressources used by the instance of this IChatClient.
 boolean connect(String username)
          Method called by when the client want to connect to a server.
 boolean disconnect(String username)
          Method called when the client wants to disconnect from the server.
 void sendMessage(IMessage msg)
          Method called when the client wants to send a message.
 

Method Detail

connect

boolean connect(String username)
Method called by when the client want to connect to a server.

Parameters:
username - The username of the client.
Returns:
True if the client was able to connect, false otherwise.

disconnect

boolean disconnect(String username)
Method called when the client wants to disconnect from the server.

Parameters:
username - The username of the client.
Returns:
True if the client was able to disconnect from the server. False otherwise.

sendMessage

void sendMessage(IMessage msg)
Method called when the client wants to send a message.

Parameters:
msg - The message to be sent as a IMessage.

close

void close()
Method called when the client wants to release all the ressources used by the instance of this IChatClient.