View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.security;
17  
18  import java.util.List;
19  
20  import javax.naming.NamingException;
21  
22  import org.seasar.tuigwaa.security.auth.TgwRole;
23  import org.seasar.tuigwaa.security.auth.TgwUser;
24  
25  
26  /***
27   * @author someda
28   */
29  public interface DirectoryService {
30  	
31  	// Directory Search Keys
32  	
33  	public static final String EMBEDED = "org.seasar.tuigwaa.EMBEDED";
34  	public static final String BASE_DN = "org.seasar.tuigwaa.BASE_DN";
35  	public static final String USER_PREFIX = "org.seasar.tuigwaa.USER_PREFIX";
36  	public static final String USER_SUFFIX = "org.seasar.tuigwaa.USER_SEARCH_DN";
37  	public static final String ROLE_PREFIX = "org.seasar.tuigwaa.ROLE_PREFIX";	
38  	public static final String ROLE_SUFFIX = "org.seasar.tuigwaa.ROLE_SUFFIX";
39  	public static final String ROLE_USER_ATTRIBUTE = "org.seasar.tuigwaa.ROLE_USER_ATTRIBUTE";
40  	public static final String ROLE_USER_PREFIXONLY = "org.seasr.tuigwaa.ROLE_USER_PREFIXONLY";
41  	public static final String PASSWORD_ATTRIBUTE = "org.seasar.tuigwaa.PASSWORD_ATTRIBUTE";
42  	public static final String DESCRIPTION_ATTRIBUTE = "org.seasar.tuigwaa.DESCRIPTION_ATTRIBUTE";
43  	public static final String ADMIN_USERNAME = "org.seasar.tuigwaa.ADMIN_USERNAME";		
44  	public static final String ADMIN_ROLENAME = "org.seasar.tuigwaa.ADMIN_ROLENAME";
45  	
46  	/***
47  	 * Read configuration properties and set basic properties
48  	 * @throws NamingException
49  	 */
50  	public void initialize() throws NamingException;
51  	
52  	public TgwUser getUser(String userdn);
53  	
54  	public List getUsers();
55  	
56  	public void addUser(TgwUser user);
57  	
58  	public void deleteUser(String userdn);
59  	
60  	public void modifyUser(TgwUser user);
61  	
62  	public TgwRole getRole(String roledn);
63  	
64  	public List getRoles();
65  	
66  	public void addRole(TgwRole role);
67  	
68  	public void deleteRole(String role);
69  	
70  	public void modifyRole(TgwRole role);
71  	
72  	public String buildUserDN(String username);
73  	
74  }