View Javadoc
1   /******************************************************************************
2    * Database - This interface defines the database API for BSAccount
3    * 
4    * BSAccount - BuckoSoft Web Account Manager 
5    * Copyright(c) 2007 - Dick Balaska and BuckoSoft, Corp.
6    * 
7    */
8   package com.buckosoft.BSAccount.db;
9   
10  import com.buckosoft.BSAccount.domain.BSAccount;
11  
12  /**
13   * @author dick
14   *
15   */
16  public interface Database {
17  	/** Get the user's account - i.e. login
18  	 * @param username The username as entered by the user
19  	 * @param password The cleartext password
20  	 * @return The user that matches or null if not found
21  	 */
22  	BSAccount	getAccount(String username, String password);
23  
24  	BSAccount	getAccount(int userId);
25  
26  	/** Get the number of accounts
27  	 * @return the number of accounts
28  	 */
29  	int			getAccountCount();
30  	/** Get the userId who wanted this appJumper
31  	 * @param appJumper The paremeter passed to the app
32  	 * @return The userId or 0 if not found
33  	 */
34  	int	getAppJumperUser(long appJumper);
35  	
36  	/** Set an appJumper.
37  	 * @param userId The userId who wants to jump apps
38  	 * @param appJumper 
39  	 */
40  	void setAppJumper(int userId, long appJumper);
41  	
42  	void deleteAppJumper(int userId, long appJumper);
43  }