1:
37:
38:
39: package ;
40:
41: import ;
42:
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48:
49:
53: public class InitialLdapContext
54: extends InitialDirContext
55: implements LdapContext
56: {
57: public InitialLdapContext ()
58: throws NamingException
59: {
60: this (null, null);
61: }
62:
63: public InitialLdapContext (Hashtable environment, Control[] connControls)
64: throws NamingException
65: {
66: super (false);
67:
68: if (connControls != null)
69: {
70: if (environment == null)
71: environment = new Hashtable ();
72: else
73: environment = (Hashtable) environment.clone ();
74: environment.put ("java.naming.ldap.control.connect",
75: connControls);
76: }
77:
78: init (environment);
79: }
80:
81: private LdapContext getDefaultInitLdapCtx ()
82: throws NamingException
83: {
84: Context c = getDefaultInitCtx ();
85: if (c == null)
86: throw new NoInitialContextException ();
87: else if (! (c instanceof LdapContext))
88: throw new NotContextException ();
89: return (LdapContext) c;
90: }
91:
92: public ExtendedResponse extendedOperation (ExtendedRequest request)
93: throws NamingException
94: {
95: return getDefaultInitLdapCtx ().extendedOperation (request);
96: }
97:
98: public Control[] getConnectControls ()
99: throws NamingException
100: {
101: return getDefaultInitLdapCtx ().getConnectControls ();
102: }
103:
104: public Control[] getRequestControls ()
105: throws NamingException
106: {
107: return getDefaultInitLdapCtx ().getRequestControls ();
108: }
109:
110: public Control[] getResponseControls ()
111: throws NamingException
112: {
113: return getDefaultInitLdapCtx ().getResponseControls ();
114: }
115:
116: public LdapContext newInstance (Control[] reqControls)
117: throws NamingException
118: {
119: return getDefaultInitLdapCtx ().newInstance (reqControls);
120: }
121:
122: public void reconnect (Control[] connControls)
123: throws NamingException
124: {
125: getDefaultInitLdapCtx ().reconnect (connControls);
126: }
127:
128: public void setRequestControls (Control[] reqControls)
129: throws NamingException
130: {
131: getDefaultInitLdapCtx ().setRequestControls (reqControls);
132: }
133: }