com.ibm.websphere.samples.plantsbywebsphereejb
Class LoginBean

java.lang.Object
  extended by com.ibm.websphere.samples.plantsbywebsphereejb.LoginBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

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

LoginBean is the implementation class for the Login stateless session EJB. LoginBean implements each of the business methods in the Login EJB remote interface and each of the EJB lifecycle methods in the javax.ejb.SessionBean interface.

See Also:
Login, LoginHome, Serialized Form

Constructor Summary
LoginBean()
           
 
Method Summary
 CustomerInfo createNewUser(java.lang.String customerID, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String addr1, java.lang.String addr2, java.lang.String addrCity, java.lang.String addrState, java.lang.String addrZip, java.lang.String phone)
          Create a new user.
 void ejbActivate()
          ejbActivate Session EJB lifecycle callback method.
 void ejbCreate()
          ejbCreate Session EJB lifecycle callback method.
 void ejbPassivate()
          ejbPassivate Session EJB lifecycle callback method.
 void ejbRemove()
          ejbRemove Session EJB lifecycle callback method.
 CustomerInfo getCustomerInfo(java.lang.String customerID)
          Retrieve an existing user.
 void setSessionContext(javax.ejb.SessionContext ctx)
          setSessionContext Session EJB lifecycle callback method to set the EJB sessionContext for this EJB.
 CustomerInfo updateUser(java.lang.String customerID, java.lang.String firstName, java.lang.String lastName, java.lang.String addr1, java.lang.String addr2, java.lang.String addrCity, java.lang.String addrState, java.lang.String addrZip, java.lang.String phone)
          Update an existing user.
 java.lang.String verifyUserAndPassword(java.lang.String customerID, java.lang.String password)
          Verify that the user exists and the password is value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginBean

public LoginBean()
Method Detail

verifyUserAndPassword

public java.lang.String verifyUserAndPassword(java.lang.String customerID,
                                              java.lang.String password)
Verify that the user exists and the password is value.

Parameters:
customerID - The customer ID
password - The password for the customer ID
Returns:
String with a results message.

createNewUser

public CustomerInfo createNewUser(java.lang.String customerID,
                                  java.lang.String password,
                                  java.lang.String firstName,
                                  java.lang.String lastName,
                                  java.lang.String addr1,
                                  java.lang.String addr2,
                                  java.lang.String addrCity,
                                  java.lang.String addrState,
                                  java.lang.String addrZip,
                                  java.lang.String phone)
Create a new user.

Parameters:
customerID - The new customer ID.
password - The password for the customer ID.
firstName - First name.
lastName - Last name.
addr1 - Address line 1.
addr2 - Address line 2.
addrCity - City address information.
addrState - State address information.
addrZip - Zip code address information.
phone - User's phone number.
Returns:
CustomerInfo

updateUser

public CustomerInfo updateUser(java.lang.String customerID,
                               java.lang.String firstName,
                               java.lang.String lastName,
                               java.lang.String addr1,
                               java.lang.String addr2,
                               java.lang.String addrCity,
                               java.lang.String addrState,
                               java.lang.String addrZip,
                               java.lang.String phone)
Update an existing user.

Parameters:
customerID - The customer ID.
firstName - First name.
lastName - Last name.
addr1 - Address line 1.
addr2 - Address line 2.
addrCity - City address information.
addrState - State address information.
addrZip - Zip code address information.
phone - User's phone number.
Returns:
CustomerInfo

getCustomerInfo

public CustomerInfo getCustomerInfo(java.lang.String customerID)
Retrieve an existing user.

Parameters:
customerID - The customer ID.
Returns:
CustomerInfo

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
ejbCreate Session EJB lifecycle callback method. This method is empty for Stateless EJB. This method corresponds to the create method in the home interface.

Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
ejbRemove Session EJB lifecycle callback method. This method is empty for Stateless EJB. Called just before the end of life for this object.

Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
ejbActivate Session EJB lifecycle callback method. This method is empty for Stateless EJB.

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
ejbPassivate Session EJB lifecycle callback method. This method is empty for Stateless EJB. Called when the instance is passivated from its "active" state, and releases.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws java.rmi.RemoteException
setSessionContext Session EJB lifecycle callback method to set the EJB sessionContext for this EJB.

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - javax.ejb.SessionContext The context for this session EJB.
Throws:
java.rmi.RemoteException - If there is a remote communication failure.