|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ReserveAndBuy interface is the remote interface for the ReserveAndBuy EJB component.
This component maintains no state related to a client between method calls. Each method is handled separately and the arguments contain all data that is necessary to perform the operation, i.e., there's no need to retrieve state from elsewhere.
This component is in the EJB tier of the architecture.
Category | Functionality: use case 2 - make reservation, 3 - purchase tickets, and 4 - cancel reservation. |
Behavior | This component is a stateless session bean used that allows the user to make reservation, cancel reservation and buy tickets to a particular flight. |
Exception handling |
The client may receive a RemoteException if a communication-related
problem occurs during a call to any method of this component.
The cause, which is not specific to the code of a particular
method, can be:
|
Clients | We don't know what clients may connect from outside of our system as the interfaces are exposed. |
Method Summary | |
void |
buyTickets(int reservationId,
CreditCardValue creditCard,
long transId)
Given the reservation ID and credit card, purchase the tickets. |
void |
cancelReservation(int reservationId,
long transId)
Given a reservation ID, mark that reservation as cancelled. |
int |
makeReservation(FlightSelection selection,
String[] passengers,
CreditCardValue creditCard,
long transId)
Given the flight, passenger information, and credit card information creates a reservation and inserts it into the database. |
ReservationValue |
readReservation(int reservationId)
Given a reservation ID, return all the reservation information. |
Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
Method Detail |
public int makeReservation(FlightSelection selection, String[] passengers, CreditCardValue creditCard, long transId) throws RemoteException, ValidationException
selection
- the flight information that the customer has selected.passengers
- the list of passengers that need tickets.creditCard
- the credit card information to reserve the tickets.transId
- Universally unique identifier for this transaction.RemoteException
- if a problem occured in the communication
between the remote client and this component.
See the description of Exception handling
for this component.ValidationException
- if flight is null or doesn't match any
existing flight in the database; if
passengers is null or all elements of the
array are null; if the credit card is null.
If the credit card informed does not
have sufficient credit to purchase the
tickets or is not valid for some reason,
as informed by the credit card
authorizer application; if there are no seats
available on the flight anymore.public void buyTickets(int reservationId, CreditCardValue creditCard, long transId) throws RemoteException, ValidationException
reservationId
- Reservation id for the flight reservation.creditCard
- credit card information that passenger uses to pay
for flight. It may differ from the credit card
informed to make the reservation.transId
- Universally unique identifier for this transaction.RemoteException
- if a problem occured in the communication
between the remote client and this component.
See the description of Exception handling
for this component.ValidationException
- if reservationId does not match any existing
reservation in the database; or if
the credit card is null or blank.
If the credit card informed does not
have sufficient credit to purchase the
tickets or is not valid for some reason,
as informed by the credit card
authorizer application; if the reservation
is no longer valid (has expired).public void cancelReservation(int reservationId, long transId) throws ValidationException, RemoteException
reservationId
- Reservation id for the flight reservation that is
being cancelled.transId
- Universally unique identifier for this transaction.RemoteException
- if a problem occured in the communication
between the remote client and this component.
See the description of Exception handling
for this component.ValidationException
- if reservationId does not match any existing
reservation in the database.public ReservationValue readReservation(int reservationId) throws RemoteException
reservationId
- Reservation id for the flight reservation that is
being queried.RemoteException
- if a problem occured in the communication
between the remote client and this component.
See the description of Exception handling
for this component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |