| java.lang.Object golfShop.data.user.UserDOImpl
UserDOImpl | public class UserDOImpl implements UserDO,User,Serializable(Code) | | The application specific user data object. This is the base object that
does most of the work. All the policy decisions happen here.
The abstract functions are for accessing the store of all users.
There will be at least 3 sub-classes that implement these functions,
one that just keeps the list in memory, one that reads and writes to a
text file, and one that acesses an ldap database. These abstract functions
are private, so that all 3 flavors appear the same to the outside world.
This is a data object, not a business object. This object hides the
storage medium (memory, file, ldap etc..). The class methods get users
from the storage medium, and create new users. The object methods give
you access to the user data, and update changes to the storage medium.
Passwords are protected, but other than that no policy is enforeced.
For example, cheching password length, making sure the correct password
was enntered etc.. is the responsiblity of the user buisness object.
author: Andrew John version: $Revision: 1.1 $ |
Method Summary | |
public static void | InitializeStorageOption(String opt, String fn) Create the correct user store. | public int | authenticate(String password) Process an authentication request. | public void | changePassword(String old, String new1, String new2, User initiatingUser) This is needed to fulfill the requirements of being a User object.
It is not used in this demo.
Changes a user's password.
The old password must be supplied and it must match the
password stored in the user database. | public void | commitChanges() Write any changes to the storage medium. | public static UserDO | createUser(String username, String password, String address1, String address2, String city, String state, String zip, String creditCard, String email) This is the public interface for creating user data objects. | public boolean | equals(Object obj) Compare this object to another user object. | public String | getAddress1() | public String | getAddress2() | public String | getCity() | public String | getCreditCard() | public String | getEmail() | public String | getName() | protected String | getPassword() | public String | getState() | public String | getZip() | public static UserDO | lookupUser(String username) | public void | setAddress1(String address1) | public void | setAddress2(String address2) | public void | setCity(String city) | public void | setCreditCard(String creditCard) | public void | setEmail(String email) | public void | setState(String state) | public void | setZip(String zip) | public String | toString() Convert to string for debugging. |
AUTH_FAILED | final public static int AUTH_FAILED(Code) | | |
AUTH_OK | final public static int AUTH_OK(Code) | | |
isDirty | protected boolean isDirty(Code) | | |
UserDOImpl | protected UserDOImpl(String username, String password, String address1, String address2, String city, String state, String zip, String creditCard, String email)(Code) | | Constructor. This is protected so that the outside world cannot
create users. To obtain an already existing user, call the class
method lookupUser(). To create a new user, call the class method
createUser().
Parameters: username - A unique String representing the user's identity. Parameters: password - A String containing the user's password. Parameters: userid - An int containing the user's unique id number. |
InitializeStorageOption | public static void InitializeStorageOption(String opt, String fn) throws ApplicationException(Code) | | Create the correct user store.
|
authenticate | public int authenticate(String password)(Code) | | Process an authentication request. Verify
that the user's account and password are valid.
Parameters: password - The password entered by the user. True if the password matches, false otherwise. |
changePassword | public void changePassword(String old, String new1, String new2, User initiatingUser) throws LoginException(Code) | | This is needed to fulfill the requirements of being a User object.
It is not used in this demo.
Changes a user's password.
The old password must be supplied and it must match the
password stored in the user database.
This only changes the copy in memory, call commitChanges() to
write the new password out to the storage medium.
|
commitChanges | public void commitChanges()(Code) | | Write any changes to the storage medium. If no changes have been
made, no action will be taken.
|
equals | public boolean equals(Object obj)(Code) | | Compare this object to another user object. They are
equal if the user name is the same.
|
setCreditCard | public void setCreditCard(String creditCard)(Code) | | |
toString | public String toString()(Code) | | Convert to string for debugging.
|
|
|