edu.rice.rubis.beans
Class SB_ViewUserInfoBean

java.lang.Object
  |
  +--edu.rice.rubis.beans.SB_ViewUserInfoBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class SB_ViewUserInfoBean
extends java.lang.Object
implements javax.ejb.SessionBean

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

Field Summary
protected  javax.sql.DataSource dataSource
           
protected  javax.naming.Context initialContext
           
protected  javax.ejb.SessionContext sessionContext
           
 
Constructor Summary
SB_ViewUserInfoBean()
           
 
Method Summary
 void ejbActivate()
          This method is empty for a stateless session bean
 void ejbCreate()
          This method is empty for a stateless session bean
 void ejbPassivate()
          This method is empty for a stateless session bean
 void ejbRemove()
          This method is empty for a stateless session bean
 java.lang.String getComments(java.lang.Integer 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(java.lang.Integer userId)
          Get the information about a user.
 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 setSessionContext(javax.ejb.SessionContext sessionContext)
          Sets the associated session context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionContext

protected javax.ejb.SessionContext sessionContext

initialContext

protected javax.naming.Context initialContext

dataSource

protected javax.sql.DataSource dataSource
Constructor Detail

SB_ViewUserInfoBean

public SB_ViewUserInfoBean()
Method Detail

getComments

public java.lang.String getComments(java.lang.Integer 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(java.lang.Integer 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

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      java.rmi.RemoteException
This method is empty for a stateless session bean

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
This method is empty for a stateless session bean
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
This method is empty for a stateless session bean
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
This method is empty for a stateless session bean
Specified by:
ejbRemove in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
                       throws java.rmi.RemoteException
Sets the associated session context. The container calls this method after the instance creation. This method is called with no transaction context. We also retrieve the Home interfaces of all RUBiS's beans.
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sessionContext - - A SessionContext interface for the instance.
Throws:
java.rmi.RemoteException - - Thrown if the instance could not perform the function requested by the container because of a system-level error.


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.