|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object transaction.TravelAgencyImpl
public class TravelAgencyImpl
Constructor Summary | |
---|---|
TravelAgencyImpl()
|
Method Summary | |
---|---|
boolean |
abort()
Abort the current transaction. |
boolean |
addResource(ResourceType resourceType,
int xid,
java.lang.String rid,
int num,
int price)
Add a new resource (e.g. hotel) to the database. |
boolean |
commit()
Commit the current transaction. |
static void |
main(java.lang.String[] args)
|
boolean |
newCustomer(ResourceType resourceType,
int xid,
java.lang.String custName)
Add a new customer to the database. |
int |
queryAvailability(ResourceType resourceType,
java.lang.String rid)
Query the availability of a resource. |
int |
queryBill(java.lang.String customerName)
Calculate the bill for a certain customer. |
int |
queryPrice(ResourceType resourceType,
java.lang.String rid)
Query the price of a resource. |
boolean |
reserve(ResourceType resourceType,
java.lang.String rid,
java.lang.String customerName)
Reserve a resource. |
boolean |
reserveItinerary(java.lang.String hotelName,
java.lang.String flightNumber,
java.lang.String agencyName,
java.lang.String customerName)
Convenience method for reserving a whole itinerary. |
boolean |
updateResource(ResourceType resourceType,
int xid,
java.lang.String rid,
int num,
int price)
Update the attributes (total capacity and price) of a resource. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TravelAgencyImpl()
Method Detail |
---|
public boolean abort()
ITravelAgency
abort
in interface ITravelAgency
public boolean commit()
ITravelAgency
commit
in interface ITravelAgency
public boolean reserve(ResourceType resourceType, java.lang.String rid, java.lang.String customerName)
ITravelAgency
reserve
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)rid
- the unique name of the hotelcustomerName
- the unique customer name
public boolean reserveItinerary(java.lang.String hotelName, java.lang.String flightNumber, java.lang.String agencyName, java.lang.String customerName)
ITravelAgency
reserveItinerary
in interface ITravelAgency
hotelName
- the unique hotel nameflightNumber
- the unique flight numberagencyName
- the unique name of the car rental agencycustomerName
- the unique customer name
public int queryAvailability(ResourceType resourceType, java.lang.String rid)
ITravelAgency
queryAvailability
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)rid
- the unique name of the resource
public int queryPrice(ResourceType resourceType, java.lang.String rid)
ITravelAgency
queryPrice
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)rid
- the unique name of the resource
public int queryBill(java.lang.String customerName)
ITravelAgency
queryBill
in interface ITravelAgency
customerName
- the unique customer name
public boolean addResource(ResourceType resourceType, int xid, java.lang.String rid, int num, int price)
ITravelAgency
addResource
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)xid
- the id of the transaction requesting this operationrid
- the unique identifier of the resource which is to be added (e.g. HotelA)num
- the total capacity of this resourceprice
- the price a customer needs to pay for reserving this resource
public boolean newCustomer(ResourceType resourceType, int xid, java.lang.String custName)
ITravelAgency
newCustomer
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)xid
- the id of the transaction requesting this operationcustName
- the unique customer name
public boolean updateResource(ResourceType resourceType, int xid, java.lang.String rid, int num, int price)
ITravelAgency
updateResource
in interface ITravelAgency
resourceType
- the type of resource (e.g. HOTEL)xid
- the id of the transaction requesting this operationrid
- the unique identifier of the resource which is to be added (e.g. HotelA)num
- a number indicating the change in total capacity, negative numbers decrease
capacity, positive values increase capacityprice
- the price a customer needs to pay for reserving this resource
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |