edu.rice.rubis.beans
Class MDB_AboutMe

java.lang.Object
  |
  +--edu.rice.rubis.beans.MDB_AboutMe
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.MessageDrivenBean, javax.jms.MessageListener, java.io.Serializable

public class MDB_AboutMe
extends java.lang.Object
implements javax.ejb.MessageDrivenBean, javax.jms.MessageListener

This is a stateless session bean used to give to a user the information about himself.

Version:
1.1
Author:
Emmanuel Cecchet and Julie Marguerite
See Also:
Serialized Form

Constructor Summary
MDB_AboutMe()
           
 
Method Summary
 void ejbCreate()
          The Message driven bean must define an ejbCreate methods with no args.
 void ejbRemove()
          A container invokes this method before it ends the life of the message-driven object.
 java.lang.String getAboutMe(java.lang.String username, java.lang.String password)
          Authenticate the user and get the information about the user.
 java.lang.String listBids(int userId, java.lang.String username, java.lang.String password, java.sql.Connection conn)
          List items the user put a bid on in the last 30 days
 java.lang.String listBoughtItems(int userId, java.sql.Connection conn)
          List items the user bought in the last 30 days
 java.lang.String listComments(int userId, java.sql.Connection conn)
          List comments about the user
 java.lang.String listItem(int userId, java.sql.Connection conn)
          List items the user is currently selling and sold in the past 30 days
 java.lang.String listWonItems(int userId, java.sql.Connection conn)
          List items the user won in the last 30 days
 void onMessage(javax.jms.Message message)
           
 java.lang.String printComment(java.lang.String userName, java.lang.String date, java.lang.String comment, int fromUserId)
          Display comment information as an HTML table row
 java.lang.String printCommentFooter()
          Comment footer printed function
 java.lang.String printCommentHeader()
          Comment header printed function
 java.lang.String printHTMLHighlighted(java.lang.String msg)
          Construct a html highlighted string.
 java.lang.String printItemFooter()
          Item footer printed function
 java.lang.String printItemUserHasBidOn(int id, java.lang.String name, float initialPrice, float maxBid, float currentPrice, int quantity, java.lang.String startDate, java.lang.String endDate, int sellerId, java.lang.String sellerName, java.lang.String username, java.lang.String password)
          Display item information for the AboutMe servlet
 java.lang.String printSell(int id, java.lang.String name, float initialPrice, float maxBid, int quantity, float reservePrice, float buyNow, java.lang.String startDate, java.lang.String endDate)
          Display item information as an HTML table row
 java.lang.String printSellHeader(java.lang.String title)
          user's sellings header printed function
 java.lang.String printUserBidsHeader()
          user's bids list header printed function
 java.lang.String printUserBoughtItem(int id, java.lang.String name, int qty, float buyNow, int sellerId, java.lang.String sellerName)
          Display item information for the AboutMe servlet
 java.lang.String printUserBoughtItemHeader()
          user's bought items list header printed function
 java.lang.String printUserWonItem(int id, java.lang.String name, float maxBid, int sellerId, java.lang.String sellerName)
          Display item information for the AboutMe servlet
 java.lang.String printUserWonItemHeader()
          user's won items list header printed function
 void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
          Set the associated context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDB_AboutMe

public MDB_AboutMe()
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Specified by:
onMessage in interface javax.jms.MessageListener

getAboutMe

public java.lang.String getAboutMe(java.lang.String username,
                                   java.lang.String password)
                            throws java.rmi.RemoteException
Authenticate the user and get the information about the user.
Returns:
a string in html format
Since:
1.1

listItem

public java.lang.String listItem(int userId,
                                 java.sql.Connection conn)
                          throws java.rmi.RemoteException
List items the user is currently selling and sold in the past 30 days

listBoughtItems

public java.lang.String listBoughtItems(int userId,
                                        java.sql.Connection conn)
                                 throws java.rmi.RemoteException
List items the user bought in the last 30 days

listWonItems

public java.lang.String listWonItems(int userId,
                                     java.sql.Connection conn)
                              throws java.rmi.RemoteException
List items the user won in the last 30 days

listComments

public java.lang.String listComments(int userId,
                                     java.sql.Connection conn)
                              throws java.rmi.RemoteException
List comments about the user

listBids

public java.lang.String listBids(int userId,
                                 java.lang.String username,
                                 java.lang.String password,
                                 java.sql.Connection conn)
                          throws java.rmi.RemoteException
List items the user put a bid on in the last 30 days

printUserBoughtItemHeader

public java.lang.String printUserBoughtItemHeader()
user's bought items list header printed function
Returns:
a string in html format
Since:
1.1

printUserWonItemHeader

public java.lang.String printUserWonItemHeader()
user's won items list header printed function
Returns:
a string in html format
Since:
1.1

printUserBidsHeader

public java.lang.String printUserBidsHeader()
user's bids list header printed function
Returns:
a string in html format
Since:
1.1

printUserBoughtItem

public java.lang.String printUserBoughtItem(int id,
                                            java.lang.String name,
                                            int qty,
                                            float buyNow,
                                            int sellerId,
                                            java.lang.String sellerName)
                                     throws java.rmi.RemoteException
Display item information for the AboutMe servlet
Returns:
a String containing HTML code
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

printItemUserHasBidOn

public java.lang.String printItemUserHasBidOn(int id,
                                              java.lang.String name,
                                              float initialPrice,
                                              float maxBid,
                                              float currentPrice,
                                              int quantity,
                                              java.lang.String startDate,
                                              java.lang.String endDate,
                                              int sellerId,
                                              java.lang.String sellerName,
                                              java.lang.String username,
                                              java.lang.String password)
                                       throws java.rmi.RemoteException
Display item information for the AboutMe servlet
Returns:
a String containing HTML code (Warning last link must be completed by servlet)
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

printSell

public java.lang.String printSell(int id,
                                  java.lang.String name,
                                  float initialPrice,
                                  float maxBid,
                                  int quantity,
                                  float reservePrice,
                                  float buyNow,
                                  java.lang.String startDate,
                                  java.lang.String endDate)
                           throws java.rmi.RemoteException
Display item information as an HTML table row
Returns:
a String containing HTML code
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

printUserWonItem

public java.lang.String printUserWonItem(int id,
                                         java.lang.String name,
                                         float maxBid,
                                         int sellerId,
                                         java.lang.String sellerName)
                                  throws java.rmi.RemoteException
Display item information for the AboutMe servlet
Returns:
a String containing HTML code
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

printSellHeader

public java.lang.String printSellHeader(java.lang.String title)
user's sellings header printed function
Returns:
a string in html format
Since:
1.1

printItemFooter

public java.lang.String printItemFooter()
Item footer printed function
Returns:
a string in html format
Since:
1.1

printCommentHeader

public java.lang.String printCommentHeader()
Comment header printed function
Returns:
a string in html format
Since:
1.1

printComment

public java.lang.String printComment(java.lang.String userName,
                                     java.lang.String date,
                                     java.lang.String comment,
                                     int fromUserId)
                              throws java.rmi.RemoteException
Display comment information as an HTML table row
Returns:
a String containing HTML code
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

printCommentFooter

public java.lang.String printCommentFooter()
Comment footer printed function
Returns:
a string in html format
Since:
1.1

printHTMLHighlighted

public java.lang.String printHTMLHighlighted(java.lang.String msg)
Construct a html highlighted string.
Parameters:
msg - the message to display
Returns:
a string in html format
Since:
1.1

setMessageDrivenContext

public void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
Set the associated context. The container call this method after the instance creation. The enterprise Bean instance should store the reference to the context object in an instance variable. This method is called with no transaction context.
Specified by:
setMessageDrivenContext in interface javax.ejb.MessageDrivenBean
Parameters:
MessageDrivenContext - A MessageDrivenContext interface for the instance.
Throws:
javax.ejb.EJBException - Thrown by the method to indicate a failure caused by a system-level error.

ejbCreate

public void ejbCreate()
The Message driven bean must define an ejbCreate methods with no args.

ejbRemove

public void ejbRemove()
A container invokes this method before it ends the life of the message-driven object. This happens when a container decides to terminate the message-driven object. This method is called with no transaction context.
Specified by:
ejbRemove in interface javax.ejb.MessageDrivenBean
Throws:
javax.ejb.EJBException - Thrown by the method to indicate a failure caused by a system-level error.


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.