net.jetrix.clients
Class ConsoleClient

java.lang.Object
  extended by net.jetrix.clients.ConsoleClient
All Implemented Interfaces:
Runnable, Client, Destination

public class ConsoleClient
extends Object
implements Client

Command line console.

Version:
$Revision: 625 $, $Date: 2005-02-18 00:28:55 +0100 (ven., 18 févr. 2005) $
Author:
Emmanuel Bourg

Constructor Summary
ConsoleClient()
           
 
Method Summary
 void disconnect()
          Trigger the disconnection of this client.
 Channel getChannel()
          Return the channel this client subscribed to.
 Date getConnectionTime()
          Return the time of the connection to the server.
 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.
 String getType()
          Return the type of the client.
 User getUser()
          Return the user associated to this client.
 String getVersion()
          Return the version number of this client.
 Message receiveMessage()
          Receive a message sent by the client.
 void run()
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleClient

public ConsoleClient()
Method Detail

getProtocol

public Protocol getProtocol()
Description copied from interface: Client
Return the protocol used by this client.

Specified by:
getProtocol in interface Client

run

public void run()
Specified by:
run in interface Runnable

send

public void send(Message message)
Description copied from interface: Client
Send a message to the client. The raw message property must be set.

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

receiveMessage

public Message receiveMessage()
                       throws IOException
Description copied from interface: Client
Receive a message sent by the client.

Specified by:
receiveMessage in interface Client
Throws:
IOException

getInetAddress

public InetAddress getInetAddress()
Description copied from interface: Client
Return the Internet address of this client.

Specified by:
getInetAddress in interface Client

setChannel

public void setChannel(Channel channel)
Description copied from interface: Client
Set the channel.

Specified by:
setChannel in interface Client

getChannel

public Channel getChannel()
Description copied from interface: Client
Return the channel this client subscribed to.

Specified by:
getChannel in interface Client

supportsMultipleChannels

public boolean supportsMultipleChannels()
Description copied from interface: Client
Tell if the client supports multiple channels simultaneously.

Specified by:
supportsMultipleChannels in interface Client

supportsAutoJoin

public boolean supportsAutoJoin()
Description copied from interface: Client
Tell if the client can be affected automatically to a channel on connecting to the server.

Specified by:
supportsAutoJoin in interface Client

getUser

public User getUser()
Description copied from interface: Client
Return the user associated to this client.

Specified by:
getUser in interface Client

getVersion

public String getVersion()
Description copied from interface: Client
Return the version number of this client.

Specified by:
getVersion in interface Client

getType

public String getType()
Description copied from interface: Client
Return the type of the client.

Specified by:
getType in interface Client

getConnectionTime

public Date getConnectionTime()
Description copied from interface: Client
Return the time of the connection to the server.

Specified by:
getConnectionTime in interface Client

getIdleTime

public long getIdleTime()
Description copied from interface: Client
Return the time in miliseconds of inactivity.

Specified by:
getIdleTime in interface Client

disconnect

public void disconnect()
Description copied from interface: Client
Trigger the disconnection of this client.

Specified by:
disconnect in interface Client


Copyright © 2001-2008 Emmanuel Bourg. All Rights Reserved.