net.jetrix
Class ClientRepository

java.lang.Object
  extended by net.jetrix.ClientRepository

public class ClientRepository
extends Object

Repository of clients connected to the server.

Version:
$Revision: 794 $, $Date: 2009-02-17 20:08:39 +0100 (Tue, 17 Feb 2009) $
Author:
Emmanuel Bourg

Method Summary
 void addClient(Client client)
          Add a client into the repository.
 void clear()
           
 Client getClient(String nickname)
          Return the client of the player or spectator with the specified nickname.
 int getClientCount()
          Return the number of clients connected to this server.
 Collection<Client> getClients()
          Return an iterator of all clients online in alphabetical order.
 int getHostCount(InetAddress address)
          Return the number of clients connected from the specified internet address.
static ClientRepository getInstance()
           
 Iterator<Client> getOperators()
          Return an iterator of operators online in alphabetical order.
 int getPlayerCount()
          Return the number of players connected to this server.
 Iterator<Client> getPlayers()
          Return an iterator of players online in alphabetical order.
 int getSpectatorCount()
          Return the number of spectators connected to this server.
 Iterator<Client> getSpectators()
          Return an iterator of spectators online in alphabetical order.
 void removeClient(Client client)
          Remove a client from the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ClientRepository getInstance()

addClient

public void addClient(Client client)
Add a client into the repository.

Parameters:
client - the client to add

removeClient

public void removeClient(Client client)
Remove a client from the repository.

Parameters:
client - the client to remove

getPlayers

public Iterator<Client> getPlayers()
Return an iterator of players online in alphabetical order.


getPlayerCount

public int getPlayerCount()
Return the number of players connected to this server.


getSpectators

public Iterator<Client> getSpectators()
Return an iterator of spectators online in alphabetical order.


getSpectatorCount

public int getSpectatorCount()
Return the number of spectators connected to this server.


getOperators

public Iterator<Client> getOperators()
Return an iterator of operators online in alphabetical order.


getClient

public Client getClient(String nickname)
Return the client of the player or spectator with the specified nickname.

Parameters:
nickname - nickname of the client to return

getClients

public Collection<Client> getClients()
Return an iterator of all clients online in alphabetical order.


getClientCount

public int getClientCount()
Return the number of clients connected to this server.


getHostCount

public int getHostCount(InetAddress address)
Return the number of clients connected from the specified internet address.

Parameters:
address -

clear

public void clear()


Copyright © 2001-2010. All Rights Reserved.