View Javadoc
1   /******************************************************************************
2    * SimpleUserFactory - This object provides a Simple User Factory
3    * 
4    * BSAccount - BuckoSoft Web Account Manager 
5    * Copyright(c) 2007 - Dick Balaska and BuckoSoft, Corp.
6    * 
7    */
8   
9   package com.buckosoft.BSAccount;
10  
11  import com.buckosoft.BSAccount.domain.BSAccount;
12  import com.buckosoft.BSAccount.domain.BSAccountUser;
13  import com.buckosoft.BSAccount.domain.BSAccountUserWebSession;
14  import com.buckosoft.BSAccount.domain.UserFactory;
15  
16  /** Implement a Simple User Factory which deals only with simple BSAccountUsers.
17   * @author dick
18   */
19  public class SimpleUserFactory implements UserFactory {
20  
21  
22  	/* (non-Javadoc)
23  	 * @see com.buckosoft.BSAccount.domain.UserFactory#getNewUser()
24  	 */
25  	public BSAccountUser getNewUser() {
26  		return(new BSAccountUser(null));
27  	}
28  
29  	/* (non-Javadoc)
30  	 * @see com.buckosoft.BSAccount.domain.UserFactory#getNewUserWebSession(com.buckosoft.BSAccount.domain.BSAccountUser)
31  	 */
32  	public BSAccountUserWebSession getNewUserWebSession(BSAccountUser user) {
33  		return(new BSAccountUserWebSession(user));
34  
35  	}
36  
37  	/** BSAccountUser has no persistent attributes per se, so just create a new one for this account
38  	 * @see com.buckosoft.BSAccount.domain.UserFactory#getUser(com.buckosoft.BSAccount.domain.BSAccount)
39  	 */
40  	public BSAccountUser getUser(BSAccount account) {
41  		return(new BSAccountUser(account));
42  	}
43  
44  }