cad.simcad.ClientImpl
Class RMIConnector

java.lang.Object
  |
  +--cad.simcad.ClientImpl.RMIConnector
All Implemented Interfaces:
NetworkConnector

public class RMIConnector
extends java.lang.Object
implements NetworkConnector

This interface of the Dispatcher logical entity seen by a Client

Author:
Charles-Philip Bentley

Constructor Summary
RMIConnector(CADConnection CA)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIConnector

public RMIConnector(CADConnection CA)
Method Detail

connect

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

Specified by:
connect in interface NetworkConnector
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

Specified by:
sendData in interface NetworkConnector
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)
Description copied from interface: NetworkConnector
Disconnect the NetworkConnector with the NetworkAcceptor

Specified by:
disconnect in interface NetworkConnector
Returns:
ConnectionReport a report object.

registerNewEmergencyVehicle

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

Specified by:
registerNewEmergencyVehicle in interface NetworkConnector
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

Specified by:
updateWorldMap in interface NetworkConnector
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