fungus.core.service
Class DummyNetwork

java.lang.Object
  |
  +--fungus.core.service.AbstractService
        |
        +--fungus.core.service.DummyNetwork
All Implemented Interfaces:
NetworkService, Service, ServiceInformation

public class DummyNetwork
extends AbstractService
implements NetworkService

Serveur réseau virtuel. Aucune connection n'est réalisé.

Since:
1.0
Version:
$Id: DummyNetwork.java,v 1.2 2003/04/30 16:59:13 djedi Exp $
Author:
"Valvassori Moïse"

Fields inherited from class fungus.core.service.AbstractService
infra
 
Fields inherited from interface fungus.core.service.NetworkService
resource
 
Constructor Summary
DummyNetwork()
          Creates a new DummyNetwork instance.
 
Method Summary
 void connect(Socket to)
          Établie une connection vers un autre hôte
 NetConnection getConnection(InetAddress host)
          Renvoie la connection vers un hote donne.
 Collection getConnections()
          Renvoie toutes les connections.
 int getPort()
          Renvoie le port ecoute par ce server
 void init()
          initialise le service.
 Set knowHosts()
          Renvoie la liste des hôtes connus.
 int numberOfHosts()
          Renvoie le nombre d'hote auquel on est connecte
 void removeConnection(String c)
          Enlève une connection de la liste des connections
 void start()
          Demare le serveur
 
Methods inherited from class fungus.core.service.AbstractService
getAuthor, getDate, getName, getType, getVersion, setInformation, setInfrastructure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fungus.core.service.Service
getType, setInfrastructure
 

Constructor Detail

DummyNetwork

public DummyNetwork()
Creates a new DummyNetwork instance.
Method Detail

init

public void init()
Description copied from interface: Service
initialise le service.
Specified by:
init in interface Service
Overrides:
init in class AbstractService

start

public void start()
Description copied from interface: NetworkService
Demare le serveur
Specified by:
start in interface NetworkService

getPort

public int getPort()
Description copied from interface: NetworkService
Renvoie le port ecoute par ce server
Specified by:
getPort in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Returns:
le numero du port

connect

public void connect(Socket to)
Description copied from interface: NetworkService
Établie une connection vers un autre hôte
Specified by:
connect in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Parameters:
to - La socket vers l'hôte distant.

getConnection

public NetConnection getConnection(InetAddress host)
Description copied from interface: NetworkService
Renvoie la connection vers un hote donne.
Specified by:
getConnection in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Parameters:
host - Addresse de l'hote
Returns:
Connection vers celui-ci ou null si elle n'existe pas.

getConnections

public Collection getConnections()
Description copied from interface: NetworkService
Renvoie toutes les connections.
Specified by:
getConnections in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Returns:
Une collection de NetConnection.

removeConnection

public void removeConnection(String c)
Description copied from interface: NetworkService
Enlève une connection de la liste des connections
Specified by:
removeConnection in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Parameters:
c - la conenction a enlever.

numberOfHosts

public int numberOfHosts()
Description copied from interface: NetworkService
Renvoie le nombre d'hote auquel on est connecte
Specified by:
numberOfHosts in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Returns:
nombre d'hote.

knowHosts

public Set knowHosts()
Description copied from interface: NetworkService
Renvoie la liste des hôtes connus.
Specified by:
knowHosts in interface NetworkService
Following copied from interface: fungus.core.service.NetworkService
Returns:
Ennumeration de InetAddress qui contient les adresses IP des hôtes