cad.simcad.gps_server
Class gps_serverI

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--cad.simcad.gps_server.gps_serverI
All Implemented Interfaces:
GPSCentralizer, GPSConnector, java.rmi.Remote, java.io.Serializable

public class gps_serverI
extends java.rmi.server.UnicastRemoteObject
implements GPSConnector, GPSCentralizer

Author:
pablo
See Also:
Serialized Form

Field Summary
static int PERIOD
           
static int REGISTRY_PORT
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
gps_serverI()
          Creates a new instance of gps_serverI
 
Method Summary
 GPSPosition[] getAllGPSPosition()
          Returns a snapshot of the position of all emergency vehicule
 GPSPosition getGPSPosition(Id id)
          Returns the GPS position with the Id id
static void registerToRegistry(java.lang.String name, java.rmi.Remote obj, boolean create)
          Register mdt_serverI object with the RMI registry.
 void setGPSPosition(GPSPosition ps)
          Update GPSPosition Try to find the GPSPosition that have same id than ps and replaces it in the list.
 
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

PERIOD

public static int PERIOD

REGISTRY_PORT

public static int REGISTRY_PORT
Constructor Detail

gps_serverI

public gps_serverI()
            throws java.rmi.RemoteException
Creates a new instance of gps_serverI

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

setGPSPosition

public void setGPSPosition(GPSPosition ps)
Update GPSPosition Try to find the GPSPosition that have same id than ps and replaces it in the list. It replace the data displayed in the Panel

Specified by:
setGPSPosition in interface GPSConnector
Pre:
A GPSPosition object with a non null.
Post:
if Id of GPSPosition is known, the GPSPosition associated with the id is updated if Id GPSPosition is not known, it is now known. Internal structure is updated

getAllGPSPosition

public GPSPosition[] getAllGPSPosition()
Returns a snapshot of the position of all emergency vehicule

Specified by:
getAllGPSPosition in interface GPSCentralizer
Pre:
-
Returns:
An array of GPSPosition objects.
Post:
The known GPSPosition qre returned

getGPSPosition

public GPSPosition getGPSPosition(Id id)
Returns the GPS position with the Id id

Specified by:
getGPSPosition in interface GPSCentralizer
Pre:
the id is know by the GPSServer.
Returns:
-GPSPosition object -null of id is not known by the GPSServer
Post:
if id is known, returns the GPSPosition associated with the id Otherwise, the method returns null.

Logo

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