KickJava   Java API By Example, From Geeks To Geeks.

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


1 package edu.rice.rubis.beans;
2
3 import javax.ejb.*;
4 import java.rmi.*;
5
6 /**
7  * This is the Remote 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 Item extends EJBObject {
12   /**
13    * Get item id.
14    *
15    * @return item id
16    * @exception RemoteException if an error occurs
17    * @since 1.0
18    */

19   public Integer JavaDoc getId() throws RemoteException;
20
21   /**
22    * Get item name. This description is usually a short description of the item.
23    *
24    * @return item name
25    * @exception RemoteException if an error occurs
26    * @since 1.0
27    */

28   public String JavaDoc getName() throws RemoteException;
29
30   /**
31    * Get item description . This is usually an HTML file describing the item.
32    *
33    * @return item description
34    * @exception RemoteException if an error occurs
35    * @since 1.0
36    */

37   public String JavaDoc getDescription() throws RemoteException;
38
39   /**
40    * Get item initial price set by the seller.
41    *
42    * @return item initial price
43    * @exception RemoteException if an error occurs
44    * @since 1.0
45    */

46   public float getInitialPrice() throws RemoteException;
47
48   /**
49    * Get how many of this item are to be sold.
50    *
51    * @return item quantity
52    * @exception RemoteException if an error occurs
53    * @since 1.0
54    */

55   public int getQuantity() throws RemoteException;
56
57   /**
58    * Get item reserve price set by the seller. The seller can refuse to sell if reserve price is not reached.
59    *
60    * @return item reserve price
61    * @exception RemoteException if an error occurs
62    * @since 1.0
63    */

64   public float getReservePrice() throws RemoteException;
65
66   /**
67    * Get item Buy Now price set by the seller. A user can directly by the item at this price (no auction).
68    *
69    * @return item Buy Now price
70    * @exception RemoteException if an error occurs
71    * @since 1.0
72    */

73   public float getBuyNow() throws RemoteException;
74
75   /**
76    * 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>
77    *
78    * @return current maximum bid or 0 if no bid
79    * @exception RemoteException if an error occurs
80    * @since 1.1
81    */

82   public float getMaxBid() throws RemoteException;
83
84   /**
85    * Get number of bids for this item. This value should be the same as doing <pre>SELECT COUNT(*) FROM bids WHERE item_id=?</pre>
86    *
87    * @return number of bids
88    * @exception RemoteException if an error occurs
89    * @since 1.1
90    */

91   public int getNbOfBids() throws RemoteException;
92
93   /**
94    * Start date of the auction in the format 'YYYY-MM-DD hh:mm:ss'
95    *
96    * @return start date of the auction
97    * @exception RemoteException if an error occurs
98    * @since 1.0
99    */

100   public String JavaDoc getStartDate() throws RemoteException;
101
102   /**
103    * End date of the auction in the format 'YYYY-MM-DD hh:mm:ss'
104    *
105    * @return end date of the auction
106    * @exception RemoteException if an error occurs
107    * @since 1.0
108    */

109   public String JavaDoc getEndDate() throws RemoteException;
110
111   /**
112    * Give the user id of the seller
113    *
114    * @return seller's user id
115    * @exception RemoteException if an error occurs
116    * @since 1.0
117    */

118   public Integer JavaDoc getSellerId() throws RemoteException;
119
120   /**
121    * Give the category id of the item
122    *
123    * @return item's category id
124    * @exception RemoteException if an error occurs
125    * @since 1.0
126    */

127   public Integer JavaDoc getCategoryId() throws RemoteException;
128
129   /**
130    * Get the seller's nickname by finding the Bean corresponding
131    * to the user.
132    *
133    * @return nickname
134    * @exception RemoteException if an error occurs
135    * @since 1.0
136    */

137   public String JavaDoc getSellerNickname() throws RemoteException;
138
139   /**
140    * Get the category name by finding the Bean corresponding to the category Id.
141    *
142    * @return category name
143    * @exception RemoteException if an error occurs
144    * @since 1.0
145    */

146   public String JavaDoc getCategoryName() throws RemoteException;
147
148
149   /**
150    * Set a new item name
151    *
152    * @param newName item name
153    * @exception RemoteException if an error occurs
154    * @since 1.0
155    */

156   public void setName(String JavaDoc newName) throws RemoteException;
157
158   /**
159    * Set a new item description
160    *
161    * @param newDescription item description
162    * @exception RemoteException if an error occurs
163    * @since 1.0
164    */

165   public void setDescription(String JavaDoc newDescription) throws RemoteException;
166
167   /**
168    * Set a new initial price for the item
169    *
170    * @param newInitialPrice item initial price
171    * @exception RemoteException if an error occurs
172    * @since 1.0
173    */

174   public void setInitialPrice(float newInitialPrice) throws RemoteException;
175
176   /**
177    * Set a new item quantity
178    *
179    * @param qty item quantity
180    * @exception RemoteException if an error occurs
181    * @since 1.0
182    */

183   public void setQuantity(int qty) throws RemoteException;
184
185   /**
186    * Set a new reserve price for the item
187    *
188    * @param newReservePrice item reserve price
189    * @exception RemoteException if an error occurs
190    * @since 1.0
191    */

192   public void setReservePrice(float newReservePrice) throws RemoteException;
193
194   /**
195    * Set a new Buy Now price for the item
196    *
197    * @param newBuyNow item Buy Now price
198    * @exception RemoteException if an error occurs
199    * @since 1.0
200    */

201   public void setBuyNow(float newBuyNow) throws RemoteException;
202
203   /**
204    * Set item maximum bid
205    *
206    * @param newMaxBid new maximum bid
207    * @exception RemoteException if an error occurs
208    * @since 1.1
209    */

210   public void setMaxBid(float newMaxBid) throws RemoteException;
211
212   /**
213    * Set the number of bids for this item
214    *
215    * @param newNbOfBids new number of bids
216    * @exception RemoteException if an error occurs
217    * @since 1.1
218    */

219   public void setNbOfBids(int newNbOfBids) throws RemoteException;
220
221   /**
222    * Add one bid for this item
223    *
224    * @exception RemoteException if an error occurs
225    * @since 1.1
226    */

227   public void addOneBid() throws RemoteException;
228
229   /**
230    * Set a new beginning date for the auction
231    *
232    * @param newDate auction new beginning date
233    * @exception RemoteException if an error occurs
234    * @since 1.0
235    */

236   public void setStartDate(String JavaDoc newDate) throws RemoteException;
237
238   /**
239    * Set a new ending date for the auction
240    *
241    * @param newDate auction new ending date
242    * @exception RemoteException if an error occurs
243    * @since 1.0
244    */

245   public void setEndDate(String JavaDoc newDate) throws RemoteException;
246
247   /**
248    * Set a new seller identifier. This id must match
249    * the primary key of the users table.
250    *
251    * @param id seller id
252    * @exception RemoteException if an error occurs
253    * @since 1.0
254    */

255   public void setSellerId(Integer JavaDoc id) throws RemoteException;
256
257   /**
258    * Set a new category identifier. This id must match
259    * the primary key of the category table.
260    *
261    * @param id category id
262    * @exception RemoteException if an error occurs
263    * @since 1.0
264    */

265   public void setCategoryId(Integer JavaDoc id) throws RemoteException;
266
267   /**
268    * Display item information as an HTML table row
269    *
270    * @return a <code>String</code> containing HTML code
271    * @exception RemoteException if an error occurs
272    * @since 1.0
273    */

274   public String JavaDoc printItem() throws RemoteException;
275
276   /**
277    * Display item information for the AboutMe servlet
278    *
279    * @return a <code>String</code> containing HTML code
280    * @exception RemoteException if an error occurs
281    * @since 1.0
282    */

283   public String JavaDoc printUserBoughtItem(int qty) throws RemoteException;
284
285   /**
286    * Display item information for the AboutMe servlet
287    *
288    * @return a <code>String</code> containing HTML code (Warning last link must be completed by servlet)
289    * @exception RemoteException if an error occurs
290    * @since 1.0
291    */

292   public String JavaDoc printItemUserHasBidOn(float bidMaxBid) throws RemoteException;
293
294   /**
295    * Display item information as an HTML table row
296    *
297    * @return a <code>String</code> containing HTML code
298    * @exception RemoteException if an error occurs
299    * @since 1.0
300    */

301   public String JavaDoc printSell() throws RemoteException;
302
303   /**
304    * Display item information for the AboutMe servlet
305    *
306    * @return a <code>String</code> containing HTML code
307    * @exception RemoteException if an error occurs
308    * @since 1.0
309    */

310   public String JavaDoc printUserWonItem() throws RemoteException;
311
312   /**
313    * Display item information for the Buy Now servlet
314    *
315    * @return a <code>String</code> containing HTML code
316    * @exception RemoteException if an error occurs
317    * @since 1.0
318    */

319   public String JavaDoc printItemDescriptionToBuyNow(int userId) throws RemoteException;
320 }
321
Popular Tags