net.jetrix
Interface Client

All Superinterfaces:
Destination, Runnable
All Known Implementing Classes:
ConsoleClient, IRCClient, QueryClient, TetrinetClient, TSpecClient

public interface Client
extends Runnable, Destination

Layer handling communication with a client. Incomming messages are turned into a server understandable format and forwarded to the apropriate destination for processing (player's channel or main server thread)

Version:
$Revision: 857 $, $Date: 2010-05-04 19:55:19 +0200 (mar., 04 mai 2010) $
Author:
Emmanuel Bourg

Method Summary
 void disconnect()
          Trigger the disconnection of this client.
 String getAgent()
          Returns the name of the user agent (GTetrinet, aTwin, Blocktrix...)
 Channel getChannel()
          Return the channel this client subscribed to.
 Date getConnectionTime()
          Return the time of the connection to the server.
 String getEncoding()
          Returns the character encoding to be used for the messages sent to the client.
 long getIdleTime()
          Return the time in miliseconds of inactivity.
 InetAddress getInetAddress()
          Return the Internet address of this client.
 Protocol getProtocol()
          Return the protocol used by this client.
 User getUser()
          Return the user associated to this client.
 String getVersion()
          Return the version of the user agent (1.13, 1.14, etc)
 Message receive()
          Receive a message sent by the client.
 void send(Message message)
          Send a message to the client.
 void setChannel(Channel channel)
          Set the channel.
 boolean supportsAutoJoin()
          Tell if the client can be affected automatically to a channel on connecting to the server.
 boolean supportsMultipleChannels()
          Tell if the client supports multiple channels simultaneously.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getProtocol

Protocol getProtocol()
Return the protocol used by this client.


getChannel

Channel getChannel()
Return the channel this client subscribed to.


setChannel

void setChannel(Channel channel)
Set the channel.


supportsMultipleChannels

boolean supportsMultipleChannels()
Tell if the client supports multiple channels simultaneously.

Since:
0.2

supportsAutoJoin

boolean supportsAutoJoin()
Tell if the client can be affected automatically to a channel on connecting to the server.

Since:
0.2

getUser

User getUser()
Return the user associated to this client.


getAgent

String getAgent()
Returns the name of the user agent (GTetrinet, aTwin, Blocktrix...)

Since:
0.3

getVersion

String getVersion()
Return the version of the user agent (1.13, 1.14, etc)


getInetAddress

InetAddress getInetAddress()
Return the Internet address of this client.


getConnectionTime

Date getConnectionTime()
Return the time of the connection to the server.


getIdleTime

long getIdleTime()
Return the time in miliseconds of inactivity.

Since:
0.2

getEncoding

String getEncoding()
Returns the character encoding to be used for the messages sent to the client.

Since:
0.3

send

void send(Message message)
Send a message to the client. The raw message property must be set.

Specified by:
send in interface Destination
Parameters:
message - the message to send

receive

Message receive()
                throws IOException
Receive a message sent by the client.

Throws:
IOException
Since:
0.3

disconnect

void disconnect()
Trigger the disconnection of this client.



Copyright © 2001-2010. All Rights Reserved.