Java Doc for UserDOImpl.java in  » J2EE » Enhydra-Demos » golfShop » data » user » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Enhydra Demos » golfShop.data.user 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $


Field Summary
final public static  intAUTH_FAILED
    
final public static  intAUTH_OK
    
protected  Stringaddress1
    
protected  Stringaddress2
    
protected  Stringcity
    
protected  StringcreditCard
    
protected  Stringemail
    
protected  booleanisDirty
    
protected  Stringstate
    
protected  Stringusername
    
protected  Stringzip
    

Constructor Summary
protected  UserDOImpl(String username, String password, String address1, String address2, String city, String state, String zip, String creditCard, String email)
     Constructor.

Method Summary
public static  voidInitializeStorageOption(String opt, String fn)
     Create the correct user store.
public  intauthenticate(String password)
     Process an authentication request.
public  voidchangePassword(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  voidcommitChanges()
     Write any changes to the storage medium.
public static  UserDOcreateUser(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  booleanequals(Object obj)
     Compare this object to another user object.
public  StringgetAddress1()
    
public  StringgetAddress2()
    
public  StringgetCity()
    
public  StringgetCreditCard()
    
public  StringgetEmail()
    
public  StringgetName()
    
protected  StringgetPassword()
    
public  StringgetState()
    
public  StringgetZip()
    
public static  UserDOlookupUser(String username)
    
public  voidsetAddress1(String address1)
    
public  voidsetAddress2(String address2)
    
public  voidsetCity(String city)
    
public  voidsetCreditCard(String creditCard)
    
public  voidsetEmail(String email)
    
public  voidsetState(String state)
    
public  voidsetZip(String zip)
    
public  StringtoString()
     Convert to string for debugging.

Field Detail
AUTH_FAILED
final public static int AUTH_FAILED(Code)



AUTH_OK
final public static int AUTH_OK(Code)



address1
protected String address1(Code)



address2
protected String address2(Code)



city
protected String city(Code)



creditCard
protected String creditCard(Code)



email
protected String email(Code)



isDirty
protected boolean isDirty(Code)



state
protected String state(Code)



username
protected String username(Code)



zip
protected String zip(Code)




Constructor Detail
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.




Method Detail
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.



createUser
public static UserDO createUser(String username, String password, String address1, String address2, String city, String state, String zip, String creditCard, String email)(Code)
This is the public interface for creating user data objects.



equals
public boolean equals(Object obj)(Code)
Compare this object to another user object. They are equal if the user name is the same.



getAddress1
public String getAddress1()(Code)



getAddress2
public String getAddress2()(Code)



getCity
public String getCity()(Code)



getCreditCard
public String getCreditCard()(Code)



getEmail
public String getEmail()(Code)



getName
public String getName()(Code)



getPassword
protected String getPassword()(Code)



getState
public String getState()(Code)



getZip
public String getZip()(Code)



lookupUser
public static UserDO lookupUser(String username)(Code)



setAddress1
public void setAddress1(String address1)(Code)



setAddress2
public void setAddress2(String address2)(Code)



setCity
public void setCity(String city)(Code)



setCreditCard
public void setCreditCard(String creditCard)(Code)



setEmail
public void setEmail(String email)(Code)



setState
public void setState(String state)(Code)



setZip
public void setZip(String zip)(Code)



toString
public String toString()(Code)
Convert to string for debugging.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.