KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > security > ejb > project > support > DirContextStringImpl


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.security.ejb.project.support;
23
24 import java.util.Hashtable JavaDoc;
25 import javax.naming.CompositeName JavaDoc;
26 import javax.naming.Context JavaDoc;
27 import javax.naming.Name JavaDoc;
28 import javax.naming.NamingEnumeration JavaDoc;
29 import javax.naming.NamingException JavaDoc;
30 import javax.naming.NameParser JavaDoc;
31 import javax.naming.directory.Attribute JavaDoc;
32 import javax.naming.directory.Attributes JavaDoc;
33 import javax.naming.directory.BasicAttributes JavaDoc;
34 import javax.naming.directory.DirContext JavaDoc;
35 import javax.naming.directory.ModificationItem JavaDoc;
36 import javax.naming.directory.SearchControls JavaDoc;
37
38 /** An abstract implementation of DirContext that simply takes every DirContext
39 method that accepts the String form of a Name and invokes the corresponding
40 method that accecpts a Name.
41
42 @author Scott_Stark@displayscape.com
43 @version $Id: DirContextStringImpl.java 37406 2005-10-29 23:41:24Z starksm $
44 */

45 public abstract class DirContextStringImpl implements DirContext JavaDoc
46 {
47     private NameParser JavaDoc nameParser;
48
49     /** Creates new DirContextStringImpl */
50     public DirContextStringImpl(NameParser JavaDoc nameParser)
51     {
52         this.nameParser = nameParser;
53     }
54     public DirContextStringImpl()
55     {
56         this(DefaultName.getNameParser());
57     }
58
59 // --- Begin DirContext interface methods that accept a String name
60
public void bind(java.lang.String JavaDoc name, Object JavaDoc obj) throws NamingException JavaDoc
61     {
62         bind(nameParser.parse(name), obj);
63     }
64     
65     public String JavaDoc composeName(String JavaDoc name,String JavaDoc name1) throws NamingException JavaDoc
66     {
67         return null;
68     }
69     
70     public Context JavaDoc createSubcontext(java.lang.String JavaDoc name) throws NamingException JavaDoc
71     {
72         return createSubcontext(nameParser.parse(name));
73     }
74     
75     public void destroySubcontext(java.lang.String JavaDoc name) throws NamingException JavaDoc
76     {
77         destroySubcontext(nameParser.parse(name));
78     }
79     
80     public NameParser JavaDoc getNameParser(java.lang.String JavaDoc name) throws NamingException JavaDoc
81     {
82         return getNameParser(nameParser.parse(name));
83     }
84     
85     public NamingEnumeration JavaDoc list(java.lang.String JavaDoc name) throws NamingException JavaDoc
86     {
87         return list(nameParser.parse(name));
88     }
89     
90     public NamingEnumeration JavaDoc listBindings(java.lang.String JavaDoc name) throws NamingException JavaDoc
91     {
92         return listBindings(nameParser.parse(name));
93     }
94     
95     public java.lang.Object JavaDoc lookup(String JavaDoc name) throws NamingException JavaDoc
96     {
97         return lookup(nameParser.parse(name));
98     }
99     public java.lang.Object JavaDoc lookupLink(String JavaDoc name) throws NamingException JavaDoc
100     {
101         return lookupLink(nameParser.parse(name));
102     }
103
104     public void rebind(String JavaDoc name,Object JavaDoc obj) throws NamingException JavaDoc
105     {
106         rebind(nameParser.parse(name), obj);
107     }
108     
109     public void rename(String JavaDoc name,String JavaDoc name1) throws NamingException JavaDoc
110     {
111         rename(nameParser.parse(name), nameParser.parse(name1));
112     }
113
114     public void unbind(String JavaDoc name) throws NamingException JavaDoc
115     {
116         unbind(nameParser.parse(name));
117     }
118
119     public void bind(String JavaDoc name,Object JavaDoc obj, Attributes JavaDoc attributes) throws NamingException JavaDoc
120     {
121         bind(nameParser.parse(name), obj, attributes);
122     }
123     
124     public DirContext JavaDoc createSubcontext(String JavaDoc name, Attributes JavaDoc attributes) throws NamingException JavaDoc
125     {
126         return createSubcontext(nameParser.parse(name), attributes);
127     }
128
129     public Attributes JavaDoc getAttributes(String JavaDoc name) throws NamingException JavaDoc
130     {
131         return getAttributes(nameParser.parse(name));
132     }
133
134     public Attributes JavaDoc getAttributes(String JavaDoc name,String JavaDoc[] attrNames) throws NamingException JavaDoc
135     {
136         return getAttributes(nameParser.parse(name), attrNames);
137     }
138     
139     public DirContext JavaDoc getSchema(String JavaDoc name) throws NamingException JavaDoc
140     {
141         return getSchema(nameParser.parse(name));
142     }
143     
144     public DirContext JavaDoc getSchemaClassDefinition(String JavaDoc name) throws NamingException JavaDoc
145     {
146         return getSchemaClassDefinition(nameParser.parse(name));
147     }
148
149     public void modifyAttributes(String JavaDoc name, ModificationItem JavaDoc[] modificationItem) throws NamingException JavaDoc
150     {
151         modifyAttributes(nameParser.parse(name), modificationItem);
152     }
153
154     public void modifyAttributes(String JavaDoc name,int index, Attributes JavaDoc attributes) throws NamingException JavaDoc
155     {
156         modifyAttributes(nameParser.parse(name), index, attributes);
157     }
158
159     public void rebind(String JavaDoc name,Object JavaDoc obj, Attributes JavaDoc attributes) throws NamingException JavaDoc
160     {
161         rebind(nameParser.parse(name), obj, attributes);
162     }
163
164     public NamingEnumeration JavaDoc search(String JavaDoc name, Attributes JavaDoc attributes) throws NamingException JavaDoc
165     {
166         return search(nameParser.parse(name), attributes);
167     }
168
169     public NamingEnumeration JavaDoc search(String JavaDoc name,String JavaDoc name1, SearchControls JavaDoc searchControls) throws NamingException JavaDoc
170     {
171         return search(nameParser.parse(name), name1, searchControls);
172     }
173     
174     public NamingEnumeration JavaDoc search(String JavaDoc name, Attributes JavaDoc attributes, String JavaDoc[] str2) throws NamingException JavaDoc
175     {
176         return search(nameParser.parse(name), attributes, str2);
177     }
178     
179     public NamingEnumeration JavaDoc search(String JavaDoc name,String JavaDoc name1, Object JavaDoc[] obj, SearchControls JavaDoc searchControls) throws NamingException JavaDoc {
180         return null;
181     }
182     
183 // --- End DirContext interface methods
184

185 }
186
Popular Tags