01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity.ldap;
17:
18: import javax.naming.directory.DirContext;
19:
20: /**
21: * Access point for obtaining LDAP contexts.
22: *
23: * @see org.acegisecurity.ldap.DefaultInitialDirContextFactory
24: *
25: * @author Luke Taylor
26: * @version $Id: InitialDirContextFactory.java 1498 2006-05-26 22:48:21Z luke_t $
27: */
28: public interface InitialDirContextFactory {
29: //~ Methods ========================================================================================================
30:
31: /**
32: * Returns the root DN of the contexts supplied by this factory.
33: * The names for searches etc. which are performed against contexts
34: * returned by this factory should be relative to the root DN.
35: *
36: * @return The DN of the contexts returned by this factory.
37: */
38: String getRootDn();
39:
40: /**
41: * Provides an initial context without specific user information.
42: *
43: * @return An initial context for the LDAP directory
44: */
45: DirContext newInitialDirContext();
46:
47: /**
48: * Provides an initial context by binding as a specific user.
49: *
50: * @param userDn the user to authenticate as when obtaining the context.
51: * @param password the user's password.
52: *
53: * @return An initial context for the LDAP directory
54: */
55: DirContext newInitialDirContext(String userDn, String password);
56: }
|