|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectTaxiProject05.model.RMIServer
public class RMIServer
| 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. |
int |
addBooking(DriveScheduleEntry driveEntry)
This is the actuall add booking method. |
void |
addCustomer(ContractCustomer customer)
|
int |
addCustomer(java.lang.String name,
java.lang.String phoneNr,
Address address)
When adding a customer to the register |
void |
addTaxi(java.lang.String regnr)
|
int |
changeBooking(int driveID,
java.util.Date startTime,
Route route,
Customer customer,
int numPassengers)
When you want to change a booking. |
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. |
java.util.Set<Address> |
FindAddress(java.lang.String address)
|
Customer |
findCustomer(int customerNr)
if you want to find a specific customer |
Drive |
findDrive(int driveID)
Finds the wanted drive given a driveID |
AddressRegister |
getAddressRegister()
|
java.util.Map<java.lang.Integer,ContractCustomer> |
getAllCustomers()
A method which gets all the customers from the Customer register and returns them. |
java.util.Date |
getCurrentDate()
|
Route |
getCurrentRoute(java.lang.String regNr)
|
CustomerRegister |
getCustomerRegister()
|
DriveSchedule |
getDriveSchedule()
|
static ModelInterface |
getInst()
|
Position |
getPosition(java.lang.String regnr)
|
java.util.LinkedList<DriveScheduleEntry> |
getSchedule(Taxi t)
|
SimTime |
getSimeTime()
|
TaxiStatus |
getStatus(java.lang.String regnr)
Happens every time a Taxi changes status. |
java.util.List<Taxi> |
getTaxiList()
|
TaxiRegister |
getTaxiRegister()
|
void |
loggedIn(java.lang.String regnr,
int driverId)
|
void |
loggedOut(java.lang.String regnr)
Event is sent when the taxi is parked. |
static void |
main(java.lang.String[] args)
|
boolean |
modifyCustomer(int customerNr,
java.lang.String name,
java.lang.String phoneNumber,
Address address)
When changing some data of the customer |
void |
removeCustomer(int customerNr)
Removes the customer with the given customerNR |
void |
removeDrive(int driveID)
Remove a drive given the driveID |
java.util.List<DriveScheduleEntry> |
requestSuitableTaxis(java.util.Date startTime,
Route route,
Customer customer,
int numPassengers)
This method finds all suiteble taxis for the given drive. |
void |
serve()
|
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 numPassengers)
Is ran when a taxi picks up a person on the street. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ModelInterface getInst()
public int addBooking(DriveScheduleEntry driveEntry)
addBooking in interface ModelInterfacestartTime - for the driveroute - the route for the drivecustomer - the customer for the drivenumPassengers - for the drive
public java.util.List<DriveScheduleEntry> requestSuitableTaxis(java.util.Date startTime,
Route route,
Customer customer,
int numPassengers)
requestSuitableTaxis in interface ModelInterfacedrive - The currentnowBooking - if the booking is within MinForBooking
public void loggedIn(java.lang.String regnr,
int driverId)
loggedIn in interface TaxiCommunicationListenerpublic void loggedOut(java.lang.String regnr)
loggedOut in interface TaxiCommunicationListenerregnr - Identify the car.
public int startedNewDrive(java.lang.String regnr,
Route route,
java.util.Date startTime,
Customer customer,
int numPassengers)
startedNewDrive in interface TaxiCommunicationListenerregnr - Idenifiys the carstartpos - The position of the pickupstartTime - 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.
public void startedBookedDrive(java.lang.String regnr,
int driveId,
Position startpos,
java.util.Date startTime)
startedBookedDrive in interface TaxiCommunicationListenerregnr - Idenifiys the cardriveId - The booked drive's id.startpos - The position where it startedstartTime - The taxi time when it started.
public 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)
endedDrive in interface TaxiCommunicationListenerregnr - Idenifiys the cardriveId - The id for the drivedistance - The distance that have been driven.endpos - The final position.driveTime - The time it tookprice - The price to pay (calculated by the taxameter)paymentMethod - The way of payment.isPayed - If it's payed or not.
public void abortDrive(java.lang.String regnr,
int driveId)
abortDrive in interface TaxiCommunicationListenerregnr - Id to the car.driveId - The drive Id.public TaxiStatus getStatus(java.lang.String regnr)
getStatus in interface ModelInterfaceregnr - Car identificationoldStatus - The previous statusnewStatus - The new set status (this will be the current status when the event is fired)public Position getPosition(java.lang.String regnr)
getPosition in interface ModelInterfacepublic void addTaxi(java.lang.String regnr)
public Drive findDrive(int driveID)
ModelInterface
findDrive in interface ModelInterfacedriveID - The driveId for the wanted drive
public void removeDrive(int driveID)
ModelInterface
removeDrive in interface ModelInterfacedriveID - the driveId for the drive you want to remove
public int changeBooking(int driveID,
java.util.Date startTime,
Route route,
Customer customer,
int numPassengers)
ModelInterface
changeBooking in interface ModelInterfacedriveID - the id for the drivestartTime - the new wanted startTime for the driveroute - The new route for the drivecustomer - customer for the drivenumPassengers - new nrOf passangers for the drive
public int addCustomer(java.lang.String name,
java.lang.String phoneNr,
Address address)
ModelInterface
addCustomer in interface ModelInterfacename - The name of the customerphoneNr - the phoneNumber of the customeraddress - The address connected to the customers invoices
public void addCustomer(ContractCustomer customer)
public Customer findCustomer(int customerNr)
ModelInterface
findCustomer in interface ModelInterfacecustomerNr - the customerNR
public void removeCustomer(int customerNr)
ModelInterface
removeCustomer in interface ModelInterfacecustomerNr - the customerNr of the customer
public boolean modifyCustomer(int customerNr,
java.lang.String name,
java.lang.String phoneNumber,
Address address)
ModelInterface
modifyCustomer in interface ModelInterfacecustomerNr - the customerNRname - The name of the customerphoneNumber - the phoneNumber of the customeraddress - The address connected to the customers invoices
public TaxiRegister getTaxiRegister()
public CustomerRegister getCustomerRegister()
public DriveSchedule getDriveSchedule()
public SimTime getSimeTime()
public static void main(java.lang.String[] args)
public void serve()
public AddressRegister getAddressRegister()
public java.util.List<Taxi> getTaxiList()
throws java.rmi.RemoteException
getTaxiList in interface ModelInterfacejava.rmi.RemoteException
public java.util.LinkedList<DriveScheduleEntry> getSchedule(Taxi t)
throws java.rmi.RemoteException
getSchedule in interface ModelInterfacejava.rmi.RemoteException
public java.util.Date getCurrentDate()
throws java.rmi.RemoteException
getCurrentDate in interface ModelInterfacejava.rmi.RemoteException
public java.util.Set<Address> FindAddress(java.lang.String address)
throws java.rmi.RemoteException
FindAddress in interface ModelInterfacejava.rmi.RemoteException
public Route getCurrentRoute(java.lang.String regNr)
throws java.rmi.RemoteException
getCurrentRoute in interface ModelInterfacejava.rmi.RemoteExceptionpublic java.util.Map<java.lang.Integer,ContractCustomer> getAllCustomers()
getAllCustomers in interface ModelInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||