|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--taxisrus.implementation.DataStoreConnection
| Inner Class Summary | |
class |
DataStoreConnection.MapData
MapData class - used for the map return. |
class |
DataStoreConnection.PolygonVertex
PolygonVertex class - used for polygon return. |
| Constructor Summary | |
DataStoreConnection()
Constructor - uses default (hard-coded in this file) name, password, and database driver to create a database connection object and database statement object. |
|
DataStoreConnection(String checkusername,
String checkpassword,
String checkdatabase,
Boolean isnew)
Constructor - uses given username, etc to create the database connection and database statement objects. |
|
| Method Summary | |
boolean |
addDenial(int cabid,
Date date)
Records a driver rejection of a customer assignment. |
void |
addMapData(String pictureName,
int x1,
int y1,
int x2,
int y2)
Inserts the data for a map, including the filename and two points representing the bounds of the map. |
boolean |
addPolygonVertex(int polyid,
int vertid,
double x,
double y)
Inserts data representing a polygon's vertex, given 2 integers representing the polygon: Zone/polygon ID ( >= 0 ), the vertex identifier ( > 0 ), and 2 doubles representing an x coordinate and a y coordinate. |
boolean |
addRideRequest(Customer newCustomer)
Stores a Customer object just after it has been created: it will not have a cab yet so it is a "ride request," but should still have all destination information. |
boolean |
cancelRideRequest(Customer theCustomer)
Records the fact that a ride has been canceled by the given customer. |
boolean |
checkCabID(int driverID,
int cabID)
Given 2 integers relaying values corresponding to a driverid and a cabid that need to be checked for validity (i.e. |
boolean |
checkNewCustomer(String check,
Statement stmt)
Given a customer and a sql.Statement object this method will find out if that customer currently exists in the customer table. |
void |
dropAllTablesInDataStore()
This method deletes all the tables from the data store. |
Vector |
getAllCabs()
Returns a vector of all of the cab objects stored in the database. |
Vector |
getAllPolygonVertices(int zoneid)
Given an integer representing a Zone/polygon identifier, this method returns all the polygon vertex data associated with that polygon in the form of a vector of polygon vertex objects that contain the desired data |
DataStoreConnection.MapData |
getMapData()
Returns a mapData object pertaining to the *one* set of MapData held in the db. |
ManagerReport |
getNumDispatcherOverrides(int specificity,
Date from,
Date to)
getNumDispatcherOverrides - given a String representing a dispatcher's name, this method returns an integer representing the number of dispatcher overrides present in the db corresponding to that dispatcher **NOTE** to effectively turn off the "date" arguments simply pass in 2 of the same date objects. |
ManagerReport |
getReport(int typeOfReport,
int specificity,
int timeInterval,
Date from,
Date to)
Returns a Report designed for a manager of the cab company, given an enumerated type of report. |
void |
ourDestructor()
Destructor - closes the connection and statement. |
String |
parseIntervalString(String interval)
parseIntervalString - given one interval ResultSet return object, it'll give you back a pretty string which is useful in reports. |
void |
removeAllPolygonVertices()
removeAllPolygonVertices - clears all rows in the mapdata table in the db INTERNAL |
boolean |
rideHasFinished(Customer theCustomer,
Date timeOfFinish,
double theFare,
double milesTraveled)
Stores the fact that the given customer has reached their destination, and creates and records statistics relevant to the ride. |
boolean |
storeCabRideAssignment(Cab theCab)
Moves the temporary customer info in the rideRequest Table into the Customers table and logs the specific ride information into the rideLog table, given a Cab object. |
boolean |
updateCabRideAssignment(Cab oldCabState,
Cab newCabState)
Updates the ridelog and customer tables, given a cab object representing the previous state of a cab-ride-assignment and a cab object representing the new state of a cab-ride-assignment. |
boolean |
updateRideRequests(Customer oldCustomerState,
Customer newCustomerState)
Updates the information in the database, given current and previous customer information. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DataStoreConnection()
public DataStoreConnection(String checkusername,
String checkpassword,
String checkdatabase,
Boolean isnew)
| Method Detail |
public void ourDestructor()
public boolean addRideRequest(Customer newCustomer)
DataStoreInterfaceaddRideRequest in interface DataStoreInterfaceDataStoreInterface.addRideRequest(Customer)public boolean storeCabRideAssignment(Cab theCab)
DataStoreInterfacestoreCabRideAssignment in interface DataStoreInterfaceDataStoreInterface.storeCabRideAssignment(Cab)
public boolean checkNewCustomer(String check,
Statement stmt)
public boolean cancelRideRequest(Customer theCustomer)
DataStoreInterfacecancelRideRequest in interface DataStoreInterfacetaxisrus.publicinterface.DataStoreInterface#cancelRideRequestCustomer(Customer)
public boolean rideHasFinished(Customer theCustomer,
Date timeOfFinish,
double theFare,
double milesTraveled)
DataStoreInterfacerideHasFinished in interface DataStoreInterfaceDataStoreInterface.rideHasFinished(Customer, Date, double, double)
public ManagerReport getReport(int typeOfReport,
int specificity,
int timeInterval,
Date from,
Date to)
DataStoreInterfacegetReport in interface DataStoreInterfaceDataStoreInterface.getReport(int, int, int, Date, Date)public Vector getAllCabs()
DataStoreInterfacegetAllCabs in interface DataStoreInterfaceDataStoreInterface.getAllCabs()
public boolean addPolygonVertex(int polyid,
int vertid,
double x,
double y)
DataStoreInterfaceaddPolygonVertex in interface DataStoreInterfacetaxisrus.publicinterface.DataStoreInterface#addPolygonVertex()public Vector getAllPolygonVertices(int zoneid)
DataStoreInterfacegetAllPolygonVertices in interface DataStoreInterfaceDataStoreInterface.getAllPolygonVertices(int)public void removeAllPolygonVertices()
removeAllPolygonVertices in interface DataStoreInterfacepublic DataStoreConnection.MapData getMapData()
DataStoreInterfacegetMapData in interface DataStoreInterfaceDataStoreInterface.getMapData()
public void addMapData(String pictureName,
int x1,
int y1,
int x2,
int y2)
DataStoreInterfaceaddMapData in interface DataStoreInterfacetaxisrus.publicinterface.DataStoreInterface#addMapData()
public boolean updateRideRequests(Customer oldCustomerState,
Customer newCustomerState)
DataStoreInterfaceupdateRideRequests in interface DataStoreInterfacetaxisrus.publicinterface.DataStoreInterface#updateRideRequests(Customer customer)
public boolean updateCabRideAssignment(Cab oldCabState,
Cab newCabState)
DataStoreInterfaceupdateCabRideAssignment in interface DataStoreInterfaceDataStoreInterface.updateCabRideAssignment(Cab, Cab)
public ManagerReport getNumDispatcherOverrides(int specificity,
Date from,
Date to)
dispatcherName - public String parseIntervalString(String interval)
interval - public void dropAllTablesInDataStore()
public boolean checkCabID(int driverID,
int cabID)
DataStoreInterfacecheckCabID in interface DataStoreInterfaceDataStoreInterface.checkCabID(int, int)
public boolean addDenial(int cabid,
Date date)
DataStoreInterfaceaddDenial in interface DataStoreInterfaceDataStoreInterface.addDenial(int, Date)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||