1 /****************************************************************************** 2 * AccountDao.java - Dao interface for the Account bean 3 * 4 * BSAccountMan - BuckoSoft Web Account Manager 5 * Copyright(c) 2007 - Dick Balaska and BuckoSoft, Corp. 6 * 7 */ 8 package com.buckosoft.BSAccountMan.db; 9 10 import com.buckosoft.BSAccount.domain.BSAccount; 11 12 /** 13 * Dao interface for the Account (user) bean 14 * 15 * @author Dick Balaska 16 * 17 */ 18 public interface AccountDao { 19 20 BSAccount getAccount(String username); // throws DataAccessException; 21 22 /** Get a BSAccount based on a numeric userid 23 * @param userid The userid 24 * @return An account if found, otherwise null 25 */ 26 BSAccount getAccount(int userid); 27 28 BSAccount getAccountByEmail(String email); 29 30 BSAccount getAccountByToken(int token); 31 32 /** Get an Account based on username and password. Useful for logging in the user 33 * @param username His typed in username 34 * @param password His typed in password 35 * @return His account if found (username and password match), otherwise null 36 */ 37 BSAccount getAccount(String username, String password); // throws DataAccessException; 38 39 void insertAccount(BSAccount account); // throws DataAccessException; 40 41 void updateAccount(BSAccount account); // throws DataAccessException; 42 43 /** Change the user's password 44 * @param account His BSAccount 45 * @param newPassword His new password 46 */ 47 void updateAccountPassword(BSAccount account, String newPassword); 48 49 // List getUsernameList(); // throws DataAccessException; 50 51 int getUserCount(); 52 53 /** Used by the mem driver to empty the "database" 54 */ 55 void resetTable(); 56 57 }