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: 440 $, $Date: 2004-10-27 02:15:39 +0200 (mer., 27 oct. 2004) $
Author:
Emmanuel Bourg

Field Summary
static Predicate OPERATOR_PREDICATE
           
static Predicate PLAYER_PREDICATE
           
static Predicate SPECTATOR_PREDICATE
           
 
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
 

Field Detail

PLAYER_PREDICATE

public static final Predicate PLAYER_PREDICATE

SPECTATOR_PREDICATE

public static final Predicate SPECTATOR_PREDICATE

OPERATOR_PREDICATE

public static final Predicate OPERATOR_PREDICATE
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-2008 Emmanuel Bourg. All Rights Reserved.