cad.simcad.mdt_server
Class mdt_serverI

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--cad.simcad.mdt_server.mdt_serverI
All Implemented Interfaces:
MDTCentralizer, MDTConnector, java.rmi.Remote, java.io.Serializable

public class mdt_serverI
extends java.rmi.server.UnicastRemoteObject
implements MDTCentralizer, MDTConnector

Unicast remote object implementing remote interface.

Version:
1.0
Author:
pablo
See Also:
Serialized Form

Field Summary
static java.lang.String MDT_REMOTE_NAME
           
static java.lang.String MDT_REMOTE_PORT
           
static int PERIOD
           
static int REGISTRY_PORT
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
mdt_serverI()
          Constructs mdt_serverI object and exports it on default port and connection on localhost.
 
Method Summary
 void directSetToBeep(Id VehId)
          JMi va etre fache pasque on a change une interface...
 Status[] getAllStatus()
          Returns a snapshot of the Status of all emergency vehicules
 Status getStatus(Id id)
          Returns the Status of object with Id id
static void registerToRegistry(java.lang.String name, java.rmi.Remote obj, boolean create)
          Register mdt_serverI object with the RMI registry.
 void sendIncidentToRemote(Incident i)
          Send Incident info.
 void setStatus(Status newStatus)
          Set the Status
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MDT_REMOTE_NAME

public static java.lang.String MDT_REMOTE_NAME

PERIOD

public static int PERIOD

REGISTRY_PORT

public static int REGISTRY_PORT

MDT_REMOTE_PORT

public static java.lang.String MDT_REMOTE_PORT
Constructor Detail

mdt_serverI

public mdt_serverI()
            throws java.rmi.RemoteException
Constructs mdt_serverI object and exports it on default port and connection on localhost.

Method Detail

registerToRegistry

public static void registerToRegistry(java.lang.String name,
                                      java.rmi.Remote obj,
                                      boolean create)
                               throws java.rmi.RemoteException,
                                      java.net.MalformedURLException
Register mdt_serverI object with the RMI registry.

Parameters:
name - - name identifying the service in the RMI registry
create - - create local registry if necessary
Throws:
java.rmi.RemoteException - if cannot be exported or bound to RMI registry
java.net.MalformedURLException - if name cannot be used to construct a valid URL
java.lang.IllegalArgumentException - if null passed as name

getAllStatus

public Status[] getAllStatus()
Description copied from interface: MDTCentralizer
Returns a snapshot of the Status of all emergency vehicules

Specified by:
getAllStatus in interface MDTCentralizer
Returns:
An array of Status objects.

getStatus

public Status getStatus(Id id)
Description copied from interface: MDTCentralizer
Returns the Status of object with Id id

Specified by:
getStatus in interface MDTCentralizer
Returns:
-Status object -null of id is not known by the MDTCentralizer

sendIncidentToRemote

public void sendIncidentToRemote(Incident i)
                          throws ConnectionToObjectException,
                                 VehiculeAssociationException,
                                 java.rmi.RemoteException
Description copied from interface: MDTCentralizer
Send Incident info. Routing info is inside the Incident objet

Specified by:
sendIncidentToRemote in interface MDTCentralizer
Parameters:
i - the Incident
Throws:
VehiculeAssociationException - if the Vehicule associated with Incident i is no more a valid vehicule Exception will tell the reason. Probably because current Status is not "free"
ConnectionToObjectException - if there was physical problem during the connection to the remote Vehicule (via MDT)
java.rmi.RemoteException

setStatus

public void setStatus(Status newStatus)
               throws java.rmi.RemoteException
Description copied from interface: MDTConnector
Set the Status

Specified by:
setStatus in interface MDTConnector
java.rmi.RemoteException

directSetToBeep

public void directSetToBeep(Id VehId)
Description copied from interface: MDTCentralizer
JMi va etre fache pasque on a change une interface...

Specified by:
directSetToBeep in interface MDTCentralizer

Logo

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