|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.ix.jspTutorial.model.PizzaAccessor
ne Class declaration
Field Summary | |
private javax.servlet.ServletContext |
myApplication
The ServletContext |
private DatabaseConnection |
myConnection
Connection to DB |
private DatabaseGenericModifier |
myModifier
Connection to the DB modifier |
private DatabaseRetriever |
myRetriever
Connection to the DB retriver object |
static java.lang.String |
vcid
version of the source |
Constructor Summary | |
PizzaAccessor(DatabaseConnection aConnection)
Create an access to a specified DB |
|
PizzaAccessor(javax.servlet.ServletContext aApplication)
Create a connection to the Instant DB Test DB. |
Method Summary | |
boolean |
checkCustomer(Customer aCustomer)
Check if a given customer is part of the DB |
Customer |
generateCustomer(javax.servlet.http.HttpServletRequest request)
Generate a Customer object with the help
* of a HttpServletRequest |
DatabaseConnection |
getConnection()
Getter method for the attribute myConnection |
void |
log(java.lang.String msg)
Output of a message to the servlet log of the container |
void |
log(java.lang.String message,
java.lang.Throwable throwable)
Output of a message and an exception to the servlet log of the container |
boolean |
newCustomer(Customer aCustomer)
Create a new customer inside the DB * |
Order |
newOrder(Customer aCustomer,
PersonalPizza aPersonalPizza)
Create a new order record inside the db and change the depending customer record if necessary. |
java.util.TreeMap |
readIngredientList(javax.servlet.ServletContext aApplication)
Read all possible ingreddients from the DB |
java.util.TreeMap |
readPizzaList(javax.servlet.ServletContext aApplication)
Read list of all possible pizza types from the DB |
void |
setConnection(DatabaseConnection aConnection)
setter method for the attribute myConnection |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static java.lang.String vcid
private DatabaseConnection myConnection
private DatabaseRetriever myRetriever
private DatabaseGenericModifier myModifier
private javax.servlet.ServletContext myApplication
Constructor Detail |
public PizzaAccessor(javax.servlet.ServletContext aApplication)
aAppliation
- current ServletContextJspTutorialStartServlet
public PizzaAccessor(DatabaseConnection aConnection)
aConnection
- database connectionMethod Detail |
public void setConnection(DatabaseConnection aConnection)
myConnection
aConnection
- database connectionDatenbankverbindungpublic DatabaseConnection getConnection()
myConnection
public java.util.TreeMap readPizzaList(javax.servlet.ServletContext aApplication)
aApplication
- current servlet contextpublic java.util.TreeMap readIngredientList(javax.servlet.ServletContext aApplication)
aApplication
- current servlet contextpublic boolean checkCustomer(Customer aCustomer)
aCustomerID
- unique id of the Pizza Service customerpublic Customer generateCustomer(javax.servlet.http.HttpServletRequest request)
Customer
object with the help
* of a HttpServletRequestrequest
- a http request
*
* @return generated customer objectpublic boolean newCustomer(Customer aCustomer)
aCustomer
- customers data
*
* @return true, if it was possible to create the new customer
* false elsepublic Order newOrder(Customer aCustomer, PersonalPizza aPersonalPizza)
aCustomer
- customer, who orderd the pizzaaPersonalPizza
- base pizza plus additional ingredientspublic void log(java.lang.String msg)
msg
- the message e Nachrichtenpublic void log(java.lang.String message, java.lang.Throwable throwable)
msg
- the message e Nachrichtenthrowable
- the exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |