KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > authentication > ldap > LDAPInitialDirContextFactory


1 /*
2  * Copyright (C) 2006 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.authentication.ldap;
18
19 import java.util.Map JavaDoc;
20
21 import javax.naming.directory.InitialDirContext JavaDoc;
22
23 import org.alfresco.repo.security.authentication.AuthenticationException;
24
25 /**
26  * Interface that defines a factory for obtaining ldap directory contexts.
27  *
28  * @author Andy Hind
29  */

30 public interface LDAPInitialDirContextFactory
31 {
32     /**
33      * Set the LDAP environment Hashtable properties used ot initialise the LDAP connection.
34      *
35      * @param environment
36      */

37     public void setInitialDirContextEnvironment(Map JavaDoc<String JavaDoc, String JavaDoc> environment);
38     
39     /**
40      * Use the environment properties and connect to the LDAP server.
41      * Used to obtain read only access to the LDAP server.
42      *
43      * @return
44      * @throws AuthenticationException
45      */

46     public InitialDirContext JavaDoc getDefaultIntialDirContext() throws AuthenticationException;
47     
48     /**
49      * Augment the connection environment with the identity and credentials and bind to the ldap server.
50      * Mainly used to validate a user's credentials during authentication.
51      *
52      * @param principal
53      * @param credentials
54      * @return
55      * @throws AuthenticationException
56      */

57     public InitialDirContext JavaDoc getInitialDirContext(String JavaDoc principal, String JavaDoc credentials) throws AuthenticationException;
58 }
59
Popular Tags