cad.simcad.objectserver.spec.cac.network
Interface NetworkConnector

All Known Implementing Classes:
RMIConnector

public interface NetworkConnector

This interface of the Dispatcher logical entity seen by a Client

Author:
Charles-Philip Bentley

Method Summary
 CADConnection connect(ConnectionData cd)
          Open a persistent connection to the host, as defined by ConnectionData
 ConnectionReport disconnect(CADConnection cc)
          Disconnect the NetworkConnector with the NetworkAcceptor
 EmergencyVehicule registerNewEmergencyVehicle()
          Ask to CAC to register a new EmergencyVehicle in its Persistent Data storage returns the newly create EmergencyVehicule
 void sendData(FieldSet fs)
          Send data over the network to a NetworkAcceptor
 void updateWorldMap(AbstractMap am)
          Update the Map ued by the Main Server.
 

Method Detail

connect

public CADConnection connect(ConnectionData cd)
                      throws CACNetworkException,
                             ConnectionDataException
Open a persistent connection to the host, as defined by ConnectionData

Pre:
ConnectionData object with host name
Throws:
CACNetworkException - if no connection could be opened, due to physical errors
ConnectionDataException - There is not enough information to open a CADConnection
Post:
A Connection is established. Any information needed to use the connection is encapsulated in a CADConnection object

sendData

public void sendData(FieldSet fs)
              throws CACNetworkException
Send data over the network to a NetworkAcceptor

Pre:
There is an open connection between this object and a NetworkAcceptor. A FieldSet object
Throws:
CACNetworkException - if there is no open connection, or a problem during the actual transfer of data
Post:
NetworkAcceptor to which we are connected has recieved the FieldSet fs

disconnect

public ConnectionReport disconnect(CADConnection cc)
Disconnect the NetworkConnector with the NetworkAcceptor

Pre:
A connection is opened. This connection is the one represented by the CADConnection object, which was recieved when the connection was opened
Returns:
ConnectionReport a report object.
Post:
The open connection is now closed

registerNewEmergencyVehicle

public EmergencyVehicule registerNewEmergencyVehicle()
                                              throws PersistentDataException
Ask to CAC to register a new EmergencyVehicle in its Persistent Data storage returns the newly create EmergencyVehicule

PersistentDataException

updateWorldMap

public void updateWorldMap(AbstractMap am)
                    throws CACNetworkException
Update the Map ued by the Main Server. For example if a new road has been built

Pre:
-
CACNetworkException
Post:
The map used by the main server is now am

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be