com.ibm.websphere.samples.pbw.ejb
Class CustomerMgr

java.lang.Object
  extended by com.ibm.websphere.samples.pbw.ejb.CustomerMgr

public class CustomerMgr
extends Object

The CustomerMgr provides a transactional facade for access to a user DB as well as simple authentication support for those users.


Constructor Summary
CustomerMgr()
           
 
Method Summary
 Customer createCustomer(String customerID, String password, String firstName, String lastName, String addr1, String addr2, String addrCity, String addrState, String addrZip, String phone)
          Create a new user.
 Customer getCustomer(String customerID)
          Retrieve an existing user.
 Customer updateUser(String customerID, String firstName, String lastName, String addr1, String addr2, String addrCity, String addrState, String addrZip, String phone)
          Update an existing user.
 String verifyUserAndPassword(String customerID, 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

CustomerMgr

public CustomerMgr()
Method Detail

createCustomer

public Customer createCustomer(String customerID,
                               String password,
                               String firstName,
                               String lastName,
                               String addr1,
                               String addr2,
                               String addrCity,
                               String addrState,
                               String addrZip,
                               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:
Customer

getCustomer

public Customer getCustomer(String customerID)
Retrieve an existing user.

Parameters:
customerID - The customer ID.
Returns:
Customer

updateUser

public Customer updateUser(String customerID,
                           String firstName,
                           String lastName,
                           String addr1,
                           String addr2,
                           String addrCity,
                           String addrState,
                           String addrZip,
                           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:
Customer

verifyUserAndPassword

public String verifyUserAndPassword(String customerID,
                                    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.


Copyright © 2011. All Rights Reserved.