1 package com.pow2.user.dao; 2 3 import com.pow2.user.User; 4 5 /*** 6 * Abstract class for User Data Access objects 7 * 8 * @author Luca Fossato 9 * @created 22 aprile 2002 10 */ 11 public interface UserDAO 12 { 13 /*** 14 * Get the data provider type 15 * 16 * @return the data provider type 17 */ 18 public String getProviderType(); 19 20 21 /*** 22 * Get the registered User identified by the input 23 * <code>login</code> and <code>passwd</code> properties. 24 * 25 * @param login Description of the Parameter 26 * @param passwd Description of the Parameter 27 * @return the registered User object if the login procedure is successful; 28 * null otherwise 29 * @exception Exception Description of the Exception 30 */ 31 public User getUser(String login, String passwd) throws Exception; 32 33 34 /*** 35 * Update the input User object with the user informations 36 * retrieved from the database. 37 * <br> 38 * This method uses the User <code>login</code> 39 * and <code>passwd</code> properties to execute the login procedure. 40 * 41 * @param user the user object with the <code>login</code> 42 * and <code>passwd</code> properties properly set. 43 * @exception Exception Description of the Exception 44 */ 45 public void getUser(User user) throws Exception; 46 47 48 /*** 49 * Persist the user informations into the database. 50 * <br> 51 * This method updates or insert a new User entry into the database 52 * depending on the user id value. 53 * 54 * @param user the user object to persist into the database 55 * @exception Exception if any error occurs 56 */ 57 public void setUser(User user) throws Exception; 58 59 60 /*** 61 * Delete the User having the input id from the database. 62 * 63 * @param id the identifier of the user to remove from the database 64 * @throws Exception if any error occurs 65 */ 66 public void deleteUser(String id) throws Exception; 67 68 69 /*** 70 * Test if the input user <code>login</code> property 71 * already exists into the application database. 72 * 73 * @param user the user object 74 * @return true if the input user login already exists into the application database; 75 * false otherwise. 76 * @exception Exception if any error occurs 77 */ 78 public boolean loginExists(User user) throws Exception; 79 80 81 /*** 82 * Test if the input <code>login</code> property 83 * already exists into the application database. 84 * 85 * @param login the login string 86 * @return true if the input login already exists into the application database; 87 * false otherwise 88 * @exception Exception if any error occurs 89 */ 90 public boolean loginExists(String login) throws Exception; 91 }