TaxiProject05.taxiSimulation
Interface TaxiCommunicationListener

All Known Implementing Classes:
RMIServer, SimTaxiRegister, TaxiCompany, TestPanel

public interface TaxiCommunicationListener

A listener to the TaxiCommunication interface. This makes an interface for the event communication from a taxi on the street to the system.

Author:
Group 5

Method Summary
 void abortDrive(java.lang.String regnr, int driveId)
          A drive is aborted, either if it's a booked drive where the customer didn't show up or if it's a started drive where the customer ran away.
 void endedDrive(java.lang.String regnr, int driveId, double distance, Position endpos, java.util.Date startTime, java.util.Date endTime, double price, PaymentMethod paymentMethod, boolean isPayed)
          Event is raised when a taxi has finished a drive.
 void loggedIn(java.lang.String regnr, int driverId)
           
 void loggedOut(java.lang.String regnr)
          Event is sent when the taxi is parked.
 void startedBookedDrive(java.lang.String regnr, int driveId, Position startpos, java.util.Date startTime)
          A customer is picked up on the street and a prebookd drive is started.
 int startedNewDrive(java.lang.String regnr, Route route, java.util.Date startTime, Customer customer, int numPassangers)
          Is ran when a taxi picks up a person on the street.
 

Method Detail

loggedIn

void loggedIn(java.lang.String regnr,
              int driverId)

loggedOut

void loggedOut(java.lang.String regnr)
Event is sent when the taxi is parked.

Parameters:
regnr - Identify the car.

startedNewDrive

int startedNewDrive(java.lang.String regnr,
                    Route route,
                    java.util.Date startTime,
                    Customer customer,
                    int numPassangers)
Is ran when a taxi picks up a person on the street.

Parameters:
regnr - Idenifiys the car
startpos - The position of the pickup
startTime - The real starttime for the pickup.
customer - If it's a formely known customer this is set to that customer, or else it's null.
Returns:
The DriveId assigned by the system.

startedBookedDrive

void startedBookedDrive(java.lang.String regnr,
                        int driveId,
                        Position startpos,
                        java.util.Date startTime)
A customer is picked up on the street and a prebookd drive is started.

Parameters:
regnr - Idenifiys the car
driveId - The booked drive's id.
startpos - The position where it started
startTime - The taxi time when it started.

endedDrive

void endedDrive(java.lang.String regnr,
                int driveId,
                double distance,
                Position endpos,
                java.util.Date startTime,
                java.util.Date endTime,
                double price,
                PaymentMethod paymentMethod,
                boolean isPayed)
Event is raised when a taxi has finished a drive. Submits drive and payment information.

Parameters:
regnr - Idenifiys the car
driveId - The id for the drive
distance - The distance that have been driven.
endpos - The final position.
driveTime - The time it took
price - The price to pay (calculated by the taxameter)
paymentMethod - The way of payment.
isPayed - If it's payed or not.

abortDrive

void abortDrive(java.lang.String regnr,
                int driveId)
A drive is aborted, either if it's a booked drive where the customer didn't show up or if it's a started drive where the customer ran away.

Parameters:
regnr - Id to the car.
driveId - The drive Id.