1:
37:
38:
39: package ;
40:
41: import ;
42:
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50:
51:
55: public class InitialDirContext extends InitialContext implements DirContext
56: {
57: public InitialDirContext ()
58: throws NamingException
59: {
60: this (null);
61: }
62:
63: protected InitialDirContext (boolean lazy)
64: throws NamingException
65: {
66: super (lazy);
67: }
68:
69: public InitialDirContext (Hashtable environment)
70: throws NamingException
71: {
72: super (environment);
73: }
74:
75:
76:
77:
78: private DirContext getURLOrDefaultInitDirCtx (Name name)
79: throws NamingException
80: {
81: Context c = getURLOrDefaultInitCtx (name);
82: if (c == null)
83: throw new NoInitialContextException ();
84: else if (! (c instanceof DirContext))
85: throw new NotContextException ();
86: return (DirContext) c;
87: }
88:
89: private DirContext getURLOrDefaultInitDirCtx (String name)
90: throws NamingException
91: {
92: Context c = getURLOrDefaultInitCtx (name);
93: if (c == null)
94: throw new NoInitialContextException ();
95: else if (! (c instanceof DirContext))
96: throw new NotContextException ();
97: return (DirContext) c;
98: }
99:
100: public Attributes getAttributes (String name)
101: throws NamingException
102: {
103: return getURLOrDefaultInitDirCtx (name).getAttributes (name);
104: }
105:
106: public Attributes getAttributes (String name, String[] attrIds)
107: throws NamingException
108: {
109: return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
110: }
111:
112: public Attributes getAttributes (Name name)
113: throws NamingException
114: {
115: return getURLOrDefaultInitDirCtx (name).getAttributes (name);
116: }
117:
118: public Attributes getAttributes(Name name, String[] attrIds)
119: throws NamingException
120: {
121: return getURLOrDefaultInitDirCtx (name).getAttributes (name, attrIds);
122: }
123:
124: public void modifyAttributes(Name name, int mod_op, Attributes attrs)
125: throws NamingException
126: {
127: getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
128: }
129:
130: public void modifyAttributes(String name, int mod_op, Attributes attrs)
131: throws NamingException
132: {
133: getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mod_op, attrs);
134: }
135:
136: public void modifyAttributes(Name name, ModificationItem[] mods)
137: throws NamingException
138: {
139: getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
140: }
141:
142: public void modifyAttributes(String name, ModificationItem[] mods)
143: throws NamingException
144: {
145: getURLOrDefaultInitDirCtx (name).modifyAttributes (name, mods);
146: }
147:
148: public void bind(Name name, Object obj, Attributes attrs)
149: throws NamingException
150: {
151: getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
152: }
153:
154: public void bind(String name, Object obj, Attributes attrs)
155: throws NamingException
156: {
157: getURLOrDefaultInitDirCtx (name).bind (name, obj, attrs);
158: }
159:
160: public void rebind(Name name, Object obj, Attributes attrs)
161: throws NamingException
162: {
163: getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
164: }
165:
166: public void rebind(String name, Object obj, Attributes attrs)
167: throws NamingException
168: {
169: getURLOrDefaultInitDirCtx (name).rebind (name, obj, attrs);
170: }
171:
172: public DirContext createSubcontext(Name name, Attributes attrs)
173: throws NamingException
174: {
175: return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
176: }
177:
178: public DirContext createSubcontext(String name, Attributes attrs)
179: throws NamingException
180: {
181: return getURLOrDefaultInitDirCtx (name).createSubcontext (name, attrs);
182: }
183:
184: public DirContext getSchema(Name name)
185: throws NamingException
186: {
187: return getURLOrDefaultInitDirCtx (name).getSchema (name);
188: }
189:
190: public DirContext getSchema(String name)
191: throws NamingException
192: {
193: return getURLOrDefaultInitDirCtx (name).getSchema (name);
194: }
195:
196: public DirContext getSchemaClassDefinition(Name name)
197: throws NamingException
198: {
199: return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
200: }
201:
202: public DirContext getSchemaClassDefinition(String name)
203: throws NamingException
204: {
205: return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
206: }
207:
208: public NamingEnumeration search(Name name, Attributes matchingAttributes,
209: String[] attributesToReturn)
210: throws NamingException
211: {
212: return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
213: attributesToReturn);
214: }
215:
216: public NamingEnumeration search(String name, Attributes matchingAttributes,
217: String[] attributesToReturn)
218: throws NamingException
219: {
220: return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
221: attributesToReturn);
222: }
223:
224: public NamingEnumeration search(Name name, Attributes matchingAttributes)
225: throws NamingException
226: {
227: return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
228: }
229:
230: public NamingEnumeration search(String name, Attributes matchingAttributes)
231: throws NamingException
232: {
233: return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
234: }
235:
236: public NamingEnumeration search(Name name, String filter,
237: SearchControls cons)
238: throws NamingException
239: {
240: return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
241: }
242:
243: public NamingEnumeration search(String name, String filter,
244: SearchControls cons)
245: throws NamingException
246: {
247: return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
248: }
249:
250: public NamingEnumeration search(Name name, String filterExpr,
251: Object[] filterArgs, SearchControls cons)
252: throws NamingException
253: {
254: return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
255: filterArgs, cons);
256: }
257:
258: public NamingEnumeration search(String name, String filterExpr,
259: Object[] filterArgs, SearchControls cons)
260: throws NamingException
261: {
262: return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
263: filterArgs, cons);
264: }
265: }