Java Doc for UserDAO.java in  » Forum » JForum-2.1.8 » net » jforum » dao » 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 » Forum » JForum 2.1.8 » net.jforum.dao 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.jforum.dao.UserDAO

All known Subclasses:   net.jforum.dao.generic.GenericUserDAO,
UserDAO
public interface UserDAO (Code)
Model interface for net.jforum.entities.User . This interface defines methods which are expected to be implementd by a specific data access driver. The intention is to provide all functionality needed to update, insert, delete and select some specific data.
author:
   Rafael Steil
version:
   $Id: UserDAO.java,v 1.10 2007/09/21 17:26:08 rafaelsteil Exp $




Method Summary
public  intaddNew(User user)
     Adds a new User. After successfuly persisting the data, this method shoud call user.setId(theNewId);, as well return the new user id.
public  voidaddNewWithId(User user)
    
public  voidaddToGroup(int userId, int[] groupId)
    
public  voiddecrementPosts(int userId)
     Decrement the number of posts of some user.
public  voiddelete(int userId)
     Deletes an user.
public  UserfindByEmail(String email)
    
public  ListfindByName(String input, boolean exactMath)
     Finds an user by matching an input string.
public  UsergetLastUserInfo()
     Gest some piece of information of the last user registered HashMap containing the information.
public  intgetTotalUsers()
    
public  intgetTotalUsersByGroup(int groupId)
     Gets the total number of users of some group.
public  StringgetUserAuthHash(int userId)
    
public  StringgetUsernameByEmail(String email)
    
public  booleanhasUsernameChanged(int userId, String usernameToCheck)
     Check if the username passed as argument is different of the username existent in the database.
public  voidincrementPosts(int userId)
     Increments the number of posts of the user.
public  booleanisDeleted(int user_id)
     whether the user is locked or not.
public  booleanisUsernameRegistered(String username)
     Checks the existence of some username.
public  ListpendingActivations()
    
public  voidremoveFromGroup(int userId, int[] groupId)
    
public  voidsaveNewPassword(String password, String email)
     Writes a new password for the user.
public  voidsaveUserAuthHash(int userId, String hash)
    
public  ListselectAll()
     Gets all users ArrayList with the users.
public  ListselectAll(int startFrom, int count)
     Gets all users
Parameters:
  startFrom - Index to start fetching from
Parameters:
  count - Number of records to retrieve ArrayList with the users.
public  ListselectAllByGroup(int groupId, int start, int count)
     Gets all users from a specific group.
Parameters:
  groupId - The group id
Parameters:
  start - The index position to start fetching
Parameters:
  count - The total number of records to fetch List with the users.
public  ListselectAllWithKarma()
     Gets all users with your Karma. List with the users.
public  ListselectAllWithKarma(int startFrom, int count)
     Gets all users
Parameters:
  startFrom - Index to start fetching from
Parameters:
  count - Number of records to retrieve ArrayList with the users.
public  UserselectById(int userId)
     Gets a specific User.
public  UserselectByName(String username)
     Gets a specific User.
Parameters:
  username - The User name to search User object containing all the informationor null if no data was found.
public  voidsetActive(int userId, boolean active)
     Set the active status. An user with the active status equals to false cannot be considered a "oficial", "fully registered" user until its status is set to true.
public  voidsetRanking(int userId, int rankingId)
     Sets the ranking.
public  voidundelete(int userId)
     Undeletes an user. The system allows user undeletation because when you call UserDAO.delete(int) the user isn't fisically deleted of the database, but just marked as deleted.
public  voidupdate(User user)
     Updates a user.
public  voidupdateUsername(int userId, String username)
     Updates only the username.
public  booleanvalidateActivationKeyHash(int userId, String hash)
    
public  UservalidateLogin(String username, String password)
     Validates the user login.
public  booleanvalidateLostPasswordHash(String email, String hash)
     Validate the provided security hash against the data stored in our system.
public  voidwriteLostPasswordHash(String email, String hash)
     Stores the "lost password" security hash, that was generated when the user asked the system to get a reminder of his password.
public  voidwriteUserActive(int userId)
    



Method Detail
addNew
public int addNew(User user)(Code)
Adds a new User. After successfuly persisting the data, this method shoud call user.setId(theNewId);, as well return the new user id.
Parameters:
  user - Reference to a valid and configured User object The new user id



addNewWithId
public void addNewWithId(User user)(Code)
Adds a new user with a predefined user id (added by Pieter for external login support)
Parameters:
  user - Reference to a valid and configured User object, with the user id already set



addToGroup
public void addToGroup(int userId, int[] groupId)(Code)
Associate the user to the group
Parameters:
  userId - The user id
Parameters:
  groupId - The group id to associate to



decrementPosts
public void decrementPosts(int userId)(Code)
Decrement the number of posts of some user.
Parameters:
  userId - The user ID do decrement the number of posts.



delete
public void delete(int userId)(Code)
Deletes an user.
Parameters:
  userId - The user ID to delete
See Also:   UserDAO.undelete(int)



findByEmail
public User findByEmail(String email)(Code)
Finds a user by its email address
Parameters:
  email - the email address to search the user instance if a match is found, or null otherwise



findByName
public List findByName(String input, boolean exactMath)(Code)
Finds an user by matching an input string.
Parameters:
  input - The username to search. May be part of the username. The method will match all users who have the input string as part of their usernames.
Parameters:
  exactMath - Set to true to get the user data related to the username passed as argument, and set it to false to search all users who match the criteria. List with the found users. Each entry is an User object, where only the id and usernamemembers are filled.



getLastUserInfo
public User getLastUserInfo()(Code)
Gest some piece of information of the last user registered HashMap containing the information. The maphas two keys:
  • userName: The username
  • userId: The user's ID



  • getTotalUsers
    public int getTotalUsers()(Code)
    Gets the total number of users The total number of users



    getTotalUsersByGroup
    public int getTotalUsersByGroup(int groupId)(Code)
    Gets the total number of users of some group.
    Parameters:
      groupId - The group id The total number of users



    getUserAuthHash
    public String getUserAuthHash(int userId)(Code)
    Retrieves the auth hash from the database
    Parameters:
      userId - intt String



    getUsernameByEmail
    public String getUsernameByEmail(String email)(Code)
    Gets the username related to the email
    Parameters:
      email - The email to search for the username The username, if found, or an empty String



    hasUsernameChanged
    public boolean hasUsernameChanged(int userId, String usernameToCheck)(Code)
    Check if the username passed as argument is different of the username existent in the database.
    Parameters:
      userId - The user's id to work with
    Parameters:
      usernameToCheck - The username to compare with the existingone in jforum_users true if the usernames are different.



    incrementPosts
    public void incrementPosts(int userId)(Code)
    Increments the number of posts of the user.
    Parameters:
      userId - The user ID to increment the number of posts



    isDeleted
    public boolean isDeleted(int user_id)(Code)
    whether the user is locked or not.
    Parameters:
      user_id - int boolean



    isUsernameRegistered
    public boolean isUsernameRegistered(String username)(Code)
    Checks the existence of some username. This method is used to ensure that will not be two equal usernames in the database.
    Parameters:
      username - The username to verify true or false, if the user was found or not, respectively



    pendingActivations
    public List pendingActivations()(Code)
    Returns a list of users that haven't yet activated their accounts



    removeFromGroup
    public void removeFromGroup(int userId, int[] groupId)(Code)
    Remove the user from the group
    Parameters:
      userId - The user id
    Parameters:
      groupId - The group id to remove the user from



    saveNewPassword
    public void saveNewPassword(String password, String email)(Code)
    Writes a new password for the user.
    Parameters:
      password - The new password
    Parameters:
      email - The user email



    saveUserAuthHash
    public void saveUserAuthHash(int userId, String hash)(Code)
    Saves the user-specific security hash to the database
    Parameters:
      userId - the user id to save
    Parameters:
      hash - the security hash



    selectAll
    public List selectAll()(Code)
    Gets all users ArrayList with the users. Each entry is an User object



    selectAll
    public List selectAll(int startFrom, int count)(Code)
    Gets all users
    Parameters:
      startFrom - Index to start fetching from
    Parameters:
      count - Number of records to retrieve ArrayList with the users. Each entry is an User object



    selectAllByGroup
    public List selectAllByGroup(int groupId, int start, int count)(Code)
    Gets all users from a specific group.
    Parameters:
      groupId - The group id
    Parameters:
      start - The index position to start fetching
    Parameters:
      count - The total number of records to fetch List with the users. Each entry is an User object



    selectAllWithKarma
    public List selectAllWithKarma()(Code)
    Gets all users with your Karma. List with the users. Each entry is an User object(with the KarmaStatus populated).



    selectAllWithKarma
    public List selectAllWithKarma(int startFrom, int count)(Code)
    Gets all users
    Parameters:
      startFrom - Index to start fetching from
    Parameters:
      count - Number of records to retrieve ArrayList with the users. Each entry is an User object(with the KarmaStatus populated).



    selectById
    public User selectById(int userId)(Code)
    Gets a specific User.
    Parameters:
      userId - The User ID to search Userobject containing all the information
    See Also:   UserDAO.selectAll



    selectByName
    public User selectByName(String username)(Code)
    Gets a specific User.
    Parameters:
      username - The User name to search User object containing all the informationor null if no data was found.
    See Also:   UserDAO.selectAll



    setActive
    public void setActive(int userId, boolean active)(Code)
    Set the active status. An user with the active status equals to false cannot be considered a "oficial", "fully registered" user until its status is set to true. This is interesting when you want to request user confirmation about registrations, for example
    Parameters:
      userId - The user ID to change the status
    Parameters:
      active - true or false



    setRanking
    public void setRanking(int userId, int rankingId)(Code)
    Sets the ranking.
    Parameters:
      userId - The user ID
    Parameters:
      rankingId - int



    undelete
    public void undelete(int userId)(Code)
    Undeletes an user. The system allows user undeletation because when you call UserDAO.delete(int) the user isn't fisically deleted of the database, but just marked as deleted. This is done to ensure data integrity.
    Parameters:
      userId - The user ID to undelete
    See Also:   UserDAO.delete(int)



    update
    public void update(User user)(Code)
    Updates a user.
    Parameters:
      user - Reference to a User object to update



    updateUsername
    public void updateUsername(int userId, String username)(Code)
    Updates only the username. This method generally will be used in implementations of net.jforum.drivers.external.LoginAuthenticator to update usernames which changed in the external source and therefore should be updated in jforum's users table.
    Parameters:
      userId - The user's id related to the username to update
    Parameters:
      username - The new username to write



    validateActivationKeyHash
    public boolean validateActivationKeyHash(int userId, String hash)(Code)
    Validate if the activated key matches the one in the database
    Parameters:
      userId - Which user to validate the activation key?
    Parameters:
      hash - The activation key true if the data matches ok, of false if it is invalid



    validateLogin
    public User validateLogin(String username, String password)(Code)
    Validates the user login.
    Parameters:
      username - The username
    Parameters:
      password - The password The user object if the provided information was corret, null if the information was invalid



    validateLostPasswordHash
    public boolean validateLostPasswordHash(String email, String hash)(Code)
    Validate the provided security hash against the data stored in our system.
    Parameters:
      email - The user email
    Parameters:
      hash - The supplied security hash true if the data matches ok, of false if it is invalid



    writeLostPasswordHash
    public void writeLostPasswordHash(String email, String hash)(Code)
    Stores the "lost password" security hash, that was generated when the user asked the system to get a reminder of his password. This hash is used to ensure the information supplied.
    Parameters:
      email - The user email
    Parameters:
      hash - The hash to store.



    writeUserActive
    public void writeUserActive(int userId)(Code)
    Set user account to active
    Parameters:
      userId - Which user account to set active?



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