KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > rubis > beans > ItemLocal


1 package edu.rice.rubis.beans;
2
3 import javax.ejb.*;
4 import java.rmi.*;
5
6 /**
7  * This is the Local Interface of the Item Bean.
8  * @author <a HREF="mailto:cecchet@rice.edu">Emmanuel Cecchet</a> and <a HREF="mailto:julie.marguerite@inrialpes.fr">Julie Marguerite</a>
9  * @version 1.1
10  */

11 public interface ItemLocal extends EJBLocalObject {
12   /**
13    * Get item id.
14    *
15    * @return item id
16    * @since 1.0
17    */

18   public Integer JavaDoc getId();
19
20   /**
21    * Get item name. This description is usually a short description of the item.
22    *
23    * @return item name
24    * @since 1.0
25    */

26   public String JavaDoc getName();
27
28   /**
29    * Get item description . This is usually an HTML file describing the item.
30    *
31    * @return item description
32    * @since 1.0
33    */

34   public String JavaDoc getDescription();
35
36   /**
37    * Get item initial price set by the seller.
38    *
39    * @return item initial price
40    * @since 1.0
41    */

42   public float getInitialPrice();
43
44   /**
45    * Get how many of this item are to be sold.
46    *
47    * @return item quantity
48    * @since 1.0
49    */

50   public int getQuantity();
51
52   /**
53    * Get item reserve price set by the seller. The seller can refuse to sell if reserve price is not reached.
54    *
55    * @return item reserve price
56    * @since 1.0
57    */

58   public float getReservePrice();
59
60   /**
61    * Get item Buy Now price set by the seller. A user can directly by the item at this price (no auction).
62    *
63    * @return item Buy Now price
64    * @since 1.0
65    */

66   public float getBuyNow();
67
68   /**
69    * Get item maximum bid (if any) for this item. This value should be the same as doing <pre>SELECT MAX(bid) FROM bids WHERE item_id=?</pre>
70    *
71    * @return current maximum bid or 0 if no bid
72    * @since 1.1
73    */

74   public float getMaxBid();
75
76   /**
77    * Get number of bids for this item. This value should be the same as doing <pre>SELECT COUNT(*) FROM bids WHERE item_id=?</pre>
78    *
79    * @return number of bids
80    * @since 1.1
81    */

82   public int getNbOfBids();
83
84   /**
85    * Start date of the auction in the format 'YYYY-MM-DD hh:mm:ss'
86    *
87    * @return start date of the auction
88    * @since 1.0
89    */

90   public String JavaDoc getStartDate();
91
92   /**
93    * End date of the auction in the format 'YYYY-MM-DD hh:mm:ss'
94    *
95    * @return end date of the auction
96    * @since 1.0
97    */

98   public String JavaDoc getEndDate();
99
100   /**
101    * Give the user id of the seller
102    *
103    * @return seller's user id
104    * @since 1.0
105    */

106   public Integer JavaDoc getSellerId();
107
108   /**
109    * Give the category id of the item
110    *
111    * @return item's category id
112    * @since 1.0
113    */

114   public Integer JavaDoc getCategoryId();
115
116   /**
117    * Get the seller's nickname by finding the Bean corresponding
118    * to the user.
119    *
120    * @return nickname
121    * @since 1.0
122    */

123   public String JavaDoc getSellerNickname();
124
125   /**
126    * Get the category name by finding the Bean corresponding to the category Id.
127    *
128    * @return category name
129    * @since 1.0
130    */

131   public String JavaDoc getCategoryName();
132
133
134   /**
135    * Set a new item name
136    *
137    * @param newName item name
138    * @since 1.0
139    */

140   public void setName(String JavaDoc newName);
141
142   /**
143    * Set a new item description
144    *
145    * @param newDescription item description
146    * @since 1.0
147    */

148   public void setDescription(String JavaDoc newDescription);
149
150   /**
151    * Set a new initial price for the item
152    *
153    * @param newInitialPrice item initial price
154    * @since 1.0
155    */

156   public void setInitialPrice(float newInitialPrice);
157
158   /**
159    * Set a new item quantity
160    *
161    * @param qty item quantity
162    * @since 1.0
163    */

164   public void setQuantity(int qty);
165
166   /**
167    * Set a new reserve price for the item
168    *
169    * @param newReservePrice item reserve price
170    * @since 1.0
171    */

172   public void setReservePrice(float newReservePrice);
173
174   /**
175    * Set a new Buy Now price for the item
176    *
177    * @param newBuyNow item Buy Now price
178    * @since 1.0
179    */

180   public void setBuyNow(float newBuyNow);
181
182   /**
183    * Set item maximum bid
184    *
185    * @param newMaxBid new maximum bid
186    * @since 1.1
187    */

188   public void setMaxBid(float newMaxBid);
189
190   /**
191    * Set the number of bids for this item
192    *
193    * @param newNbOfBids new number of bids
194    * @since 1.1
195    */

196   public void setNbOfBids(int newNbOfBids);
197
198   /**
199    * Add one bid for this item
200    *
201    * @since 1.1
202    */

203   public void addOneBid();
204
205   /**
206    * Set a new beginning date for the auction
207    *
208    * @param newDate auction new beginning date
209    * @since 1.0
210    */

211   public void setStartDate(String JavaDoc newDate);
212
213   /**
214    * Set a new ending date for the auction
215    *
216    * @param newDate auction new ending date
217    * @since 1.0
218    */

219   public void setEndDate(String JavaDoc newDate);
220
221   /**
222    * Set a new seller identifier. This id must match
223    * the primary key of the users table.
224    *
225    * @param id seller id
226    * @since 1.0
227    */

228   public void setSellerId(Integer JavaDoc id);
229
230   /**
231    * Set a new category identifier. This id must match
232    * the primary key of the category table.
233    *
234    * @param id category id
235    * @since 1.0
236    */

237   public void setCategoryId(Integer JavaDoc id);
238
239   /**
240    * Display item information as an HTML table row
241    *
242    * @return a <code>String</code> containing HTML code
243    * @since 1.0
244    */

245   public String JavaDoc printItem();
246
247   /**
248    * Display item information for the AboutMe servlet
249    *
250    * @return a <code>String</code> containing HTML code
251    * @since 1.0
252    */

253   public String JavaDoc printUserBoughtItem(int qty);
254
255   /**
256    * Display item information for the AboutMe servlet
257    *
258    * @return a <code>String</code> containing HTML code (Warning last link must be completed by servlet)
259    * @since 1.0
260    */

261   public String JavaDoc printItemUserHasBidOn(float bidMaxBid);
262
263   /**
264    * Display item information as an HTML table row
265    *
266    * @return a <code>String</code> containing HTML code
267    * @since 1.0
268    */

269   public String JavaDoc printSell();
270
271   /**
272    * Display item information for the AboutMe servlet
273    *
274    * @return a <code>String</code> containing HTML code
275    * @since 1.0
276    */

277   public String JavaDoc printUserWonItem();
278
279   /**
280    * Display item information for the Buy Now servlet
281    *
282    * @return a <code>String</code> containing HTML code
283    * @since 1.0
284    */

285   public String JavaDoc printItemDescriptionToBuyNow(int userId);
286 }
287
Popular Tags