KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > naming > DirContextImpl


1 /*
2  * Copyright (c) 1998-2002 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.naming;
30
31 import com.caucho.log.Log;
32 import com.caucho.util.L10N;
33
34 import javax.naming.Name JavaDoc;
35 import javax.naming.NamingEnumeration JavaDoc;
36 import javax.naming.directory.Attributes JavaDoc;
37 import javax.naming.directory.DirContext JavaDoc;
38 import javax.naming.directory.ModificationItem JavaDoc;
39 import javax.naming.directory.SearchControls JavaDoc;
40 import java.util.Hashtable JavaDoc;
41 import java.util.logging.Logger JavaDoc;
42
43 /**
44  * Resin's implementation of the JNDI <code>DirContext</code>.
45  * The actual storage
46  * of the persistent data is in the <code>AbstractModel</code>.
47  *
48  * <p>The <code>DirContextImpl</code> is just a Visitor around
49  * the <code>AbstractModel</code> which also encapsulate
50  * the JNDI environment.
51  *
52  * <p>In JNDI, each <code>Context</code> is a &lt;model, env> pair.
53  * Each client might pass a different environment
54  * to the <code>InitialContext</code> so each <code>ContextImpl</code>
55  * must be unique for each client. (Granted, this is a bit wasteful of
56  * space which is why JNDI values should be cached.)
57  *
58  * <p>Applications which want a different model can still use
59  * <code>ContextImpl</code> and specify the root
60  * object for <code>AbstractModel</code>. <code>ContextImpl</code> will
61  * take care of the JNDI API for the model.
62  */

63 public class DirContextImpl extends ContextImpl implements DirContext JavaDoc {
64   protected static L10N L = new L10N(DirContextImpl.class);
65   protected static Logger JavaDoc log = Log.open(DirContextImpl.class);
66
67   /**
68    * Creates a <code>DirContextImpl</code>.
69    *
70    * @param model The underlying storage node.
71    * @param env The client's JNDI environment.
72    */

73   public DirContextImpl(AbstractModel model, Hashtable JavaDoc env)
74   {
75     super(model, env);
76   }
77
78   /**
79    * Creates a <code>DirContextImpl</code>.
80    *
81    * @param name JNDI name, used for error messages, etc.
82    * @param model The underlying storage node.
83    * @param env The client's JNDI environment.
84    */

85   public DirContextImpl(String JavaDoc name, AbstractModel model, Hashtable JavaDoc env)
86   {
87     super(name, model, env);
88   }
89
90   /**
91    * Creates a new instance of the <code>ContextImpl</code>. Subclasses will
92    * override this method to return a new instance of the subclass.
93    *
94    * @param name the JNDI name for the new context
95    * @param model the underlying storage node
96    * @param env the client's JNDI environment.
97    *
98    * @return a new instance of the implementing class.
99    */

100   protected ContextImpl create(String JavaDoc name, AbstractModel model, Hashtable JavaDoc env)
101   {
102     return new DirContextImpl(name, model, env);
103   }
104
105   // stubs for now
106

107   public void bind(Name JavaDoc name, Object JavaDoc obj, Attributes JavaDoc attrs)
108   {
109     throw new UnsupportedOperationException JavaDoc();
110   }
111
112   public void bind(String JavaDoc name, Object JavaDoc obj, Attributes JavaDoc attrs)
113   {
114     throw new UnsupportedOperationException JavaDoc();
115   }
116
117   public DirContext JavaDoc createSubcontext(Name JavaDoc name, Attributes JavaDoc attrs)
118   {
119     throw new UnsupportedOperationException JavaDoc();
120   }
121
122   public DirContext JavaDoc createSubcontext(String JavaDoc name, Attributes JavaDoc attrs)
123   {
124     throw new UnsupportedOperationException JavaDoc();
125   }
126
127   public Attributes JavaDoc getAttributes(Name JavaDoc name)
128   {
129     throw new UnsupportedOperationException JavaDoc();
130   }
131
132   public Attributes JavaDoc getAttributes(String JavaDoc name)
133   {
134     throw new UnsupportedOperationException JavaDoc();
135   }
136
137   public Attributes JavaDoc getAttributes(Name JavaDoc name, String JavaDoc []attrIds)
138   {
139     throw new UnsupportedOperationException JavaDoc();
140   }
141
142   public Attributes JavaDoc getAttributes(String JavaDoc name, String JavaDoc []attrIds)
143   {
144     throw new UnsupportedOperationException JavaDoc();
145   }
146
147   public DirContext JavaDoc getSchema(Name JavaDoc name)
148   {
149     throw new UnsupportedOperationException JavaDoc();
150   }
151
152   public DirContext JavaDoc getSchema(String JavaDoc name)
153   {
154     throw new UnsupportedOperationException JavaDoc();
155   }
156
157   public DirContext JavaDoc getSchemaClassDefinition(Name JavaDoc name)
158   {
159     throw new UnsupportedOperationException JavaDoc();
160   }
161
162   public DirContext JavaDoc getSchemaClassDefinition(String JavaDoc name)
163   {
164     throw new UnsupportedOperationException JavaDoc();
165   }
166
167   public void modifyAttributes(Name JavaDoc name, int mod_op, Attributes JavaDoc attrs)
168   {
169     throw new UnsupportedOperationException JavaDoc();
170   }
171
172   public void modifyAttributes(String JavaDoc name, int mod_op, Attributes JavaDoc attrs)
173   {
174     throw new UnsupportedOperationException JavaDoc();
175   }
176
177   public void modifyAttributes(Name JavaDoc name, ModificationItem JavaDoc []mods)
178   {
179     throw new UnsupportedOperationException JavaDoc();
180   }
181
182   public void modifyAttributes(String JavaDoc name, ModificationItem JavaDoc []mods)
183   {
184     throw new UnsupportedOperationException JavaDoc();
185   }
186
187   public void rebind(Name JavaDoc name, Object JavaDoc obj, Attributes JavaDoc attrs)
188   {
189     throw new UnsupportedOperationException JavaDoc();
190   }
191
192   public void rebind(String JavaDoc name, Object JavaDoc obj, Attributes JavaDoc attrs)
193   {
194     throw new UnsupportedOperationException JavaDoc();
195   }
196
197   public NamingEnumeration JavaDoc search(Name JavaDoc name, Attributes JavaDoc attrs)
198   {
199     throw new UnsupportedOperationException JavaDoc();
200   }
201
202   public NamingEnumeration JavaDoc search(String JavaDoc name, Attributes JavaDoc attrs)
203   {
204     throw new UnsupportedOperationException JavaDoc();
205   }
206
207   public NamingEnumeration JavaDoc search(Name JavaDoc name, Attributes JavaDoc attrs, String JavaDoc []args)
208   {
209     throw new UnsupportedOperationException JavaDoc();
210   }
211
212   public NamingEnumeration JavaDoc search(String JavaDoc name, Attributes JavaDoc attrs, String JavaDoc []args)
213   {
214     throw new UnsupportedOperationException JavaDoc();
215   }
216
217   public NamingEnumeration JavaDoc search(Name JavaDoc name, String JavaDoc filterExpr,
218                                   Object JavaDoc []filterArgs, SearchControls JavaDoc cons)
219   {
220     throw new UnsupportedOperationException JavaDoc();
221   }
222
223   public NamingEnumeration JavaDoc search(String JavaDoc name, String JavaDoc filterExpr,
224                                   Object JavaDoc []filterArgs, SearchControls JavaDoc cons)
225   {
226     throw new UnsupportedOperationException JavaDoc();
227   }
228
229   public NamingEnumeration JavaDoc search(Name JavaDoc name, String JavaDoc filterExpr,
230                                   SearchControls JavaDoc cons)
231   {
232     throw new UnsupportedOperationException JavaDoc();
233   }
234
235   public NamingEnumeration JavaDoc search(String JavaDoc name, String JavaDoc filterExpr,
236                                   SearchControls JavaDoc cons)
237   {
238     throw new UnsupportedOperationException JavaDoc();
239   }
240
241   /**
242    * Returns a string value.
243    */

244   public String JavaDoc toString()
245   {
246     return "[DirContextImpl " + _name + "]";
247   }
248 }
249
Popular Tags