net.jetrix.agent
Class QueryAgent

java.lang.Object
  extended by net.jetrix.agent.QueryAgent
All Implemented Interfaces:
Agent

public class QueryAgent
extends Object
implements Agent

Version:
$Revision: 591 $, $Date: 2005-01-13 00:14:16 +0100 (jeu., 13 janv. 2005) $
Author:
Emmanuel Bourg

Constructor Summary
QueryAgent()
           
 
Method Summary
 void connect(String hostname)
          Connect to the specified server.
 void disconnect()
          Disconnect from the server.
 List<ChannelInfo> getChannels()
           
 QueryInfo getInfo()
          Fetch the information about the server.
 long getPing()
          Return the ping time to the server in milliseconds.
 int getPlayerNumber()
          Return the number of players logged in (usualy in the first channel only).
 List<PlayerInfo> getPlayers()
           
 String getVersion()
          Return the version of the server.
 void receive(Message message)
          Receive a message sent by the server.
 void send(Message message)
          Send a message to the server.
 void send(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryAgent

public QueryAgent()
Method Detail

connect

public void connect(String hostname)
             throws IOException
Description copied from interface: Agent
Connect to the specified server.

Specified by:
connect in interface Agent
Parameters:
hostname - the name or ip of the server
Throws:
IOException

disconnect

public void disconnect()
                throws IOException
Description copied from interface: Agent
Disconnect from the server.

Specified by:
disconnect in interface Agent
Throws:
IOException

send

public void send(String message)
          throws IOException
Throws:
IOException

send

public void send(Message message)
          throws IOException
Description copied from interface: Agent
Send a message to the server.

Specified by:
send in interface Agent
Parameters:
message - the message to send
Throws:
IOException

receive

public void receive(Message message)
             throws IOException
Description copied from interface: Agent
Receive a message sent by the server.

Specified by:
receive in interface Agent
Throws:
IOException

getInfo

public QueryInfo getInfo()
                  throws IOException
Fetch the information about the server.

Throws:
IOException

getVersion

public String getVersion()
                  throws IOException
Return the version of the server.

Throws:
IOException

getPlayerNumber

public int getPlayerNumber()
                    throws IOException
Return the number of players logged in (usualy in the first channel only).

Throws:
IOException

getChannels

public List<ChannelInfo> getChannels()
                              throws IOException
Throws:
IOException

getPlayers

public List<PlayerInfo> getPlayers()
                            throws IOException
Throws:
IOException

getPing

public long getPing()
             throws IOException
Return the ping time to the server in milliseconds.

Throws:
IOException


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