edu.rice.rubis.beans
Class MDB_ViewUserInfo

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

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

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

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

Constructor Summary
MDB_ViewUserInfo()
           
 
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 getComments(int userId, java.sql.Connection conn)
          Get the comment related to a specific user.
 java.lang.String getHTMLGeneralUserInformation(java.lang.String firstname, java.lang.String lastname, java.lang.String nickname, java.lang.String email, java.lang.String creationDate, int rating)
          Returns a string displaying general information about the user.
 java.lang.String getUserInfo(int userId)
          Get the information about a user.
 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
 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_ViewUserInfo

public MDB_ViewUserInfo()
Method Detail

onMessage

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

getComments

public java.lang.String getComments(int userId,
                                    java.sql.Connection conn)
                             throws java.rmi.RemoteException
Get the comment related to a specific user.
Parameters:
userHome - an UserHome value
userId - a user id
Returns:
a string in html format
Since:
1.1

getUserInfo

public java.lang.String getUserInfo(int userId)
                             throws java.rmi.RemoteException
Get the information about a user.
Parameters:
userId - a user id
Returns:
a string in html format
Since:
1.1

getHTMLGeneralUserInformation

public java.lang.String getHTMLGeneralUserInformation(java.lang.String firstname,
                                                      java.lang.String lastname,
                                                      java.lang.String nickname,
                                                      java.lang.String email,
                                                      java.lang.String creationDate,
                                                      int rating)
                                               throws java.rmi.RemoteException
Returns a string displaying general information about the user. The string contains HTML tags.
Returns:
string containing general user information
Throws:
java.rmi.RemoteException - if an error occurs

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

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.