View Javadoc

1   /*
2    * AccountMapper.java
3    *
4    * Created on March 30, 2004, 5:56 PM
5    */
6   
7   package gov.bnl.gums.account;
8   
9   import javax.persistence.DiscriminatorColumn;
10  import javax.persistence.DiscriminatorType;
11  import javax.persistence.Entity;
12  import javax.persistence.Inheritance;
13  import javax.persistence.InheritanceType;
14  
15  import gov.bnl.gums.SiteUser;
16  import gov.bnl.gums.configuration.ConfigElement;
17  import gov.bnl.gums.configuration.Configuration;
18  
19  /** 
20   * Defines the logic with which a user will be mapped to a local account.
21   * As of now, the logic is a simple certificate subject mapped to a user
22   * account. In the future this interface will be extended to map the credential
23   * of a full proxy (DN, vo, role, group) to a user and group account.
24   *
25   * @author  Gabriele Carcassi, Jay Packard
26   */
27  @Entity
28  @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
29  @DiscriminatorColumn(
30      name="type",
31      discriminatorType=DiscriminatorType.STRING
32  )
33  public abstract class AccountMapper extends ConfigElement {
34  	/**
35  	 * Create an account mapper object - empty constructor needed by XML Digestor
36  	 */
37  	public AccountMapper() {
38      }
39  	
40  	/**
41  	 * Create an account mapper object with a given configuration and name
42  	 * 
43  	 * @param configuration
44  	 * @param name
45  	 */
46  	public AccountMapper(Configuration configuration, String name) {
47  		super(configuration, name);
48      }
49   	
50  	/**
51       * Maps a grid user to a site user.
52       * @param the GridUser
53       * @return a user account (i.e. 'atlas').
54       */
55      public abstract SiteUser mapDn(String dn, boolean createNew);
56  
57  }