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: *
22: DOCUMENT ME!
23: *
24: * @author Luke Taylor
25: * @version $Id$
26: */
27: public class MockInitialDirContextFactory implements
28: InitialDirContextFactory {
29: //~ Instance fields ================================================================================================
30:
31: DirContext ctx;
32: String baseDn;
33:
34: //~ Constructors ===================================================================================================
35:
36: public MockInitialDirContextFactory(DirContext ctx, String baseDn) {
37: this .baseDn = baseDn;
38: this .ctx = ctx;
39: }
40:
41: //~ Methods ========================================================================================================
42:
43: public String getRootDn() {
44: return baseDn;
45: }
46:
47: public DirContext newInitialDirContext() {
48: return ctx;
49: }
50:
51: public DirContext newInitialDirContext(String username,
52: String password) {
53: return ctx;
54: }
55: }
|