1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.util.ldap;
24  
25  import javax.naming.Name;
26  import javax.naming.NamingEnumeration;
27  import javax.naming.NamingException;
28  import javax.naming.OperationNotSupportedException;
29  import javax.naming.directory.Attributes;
30  import javax.naming.directory.DirContext;
31  import javax.naming.directory.ModificationItem;
32  import javax.naming.directory.SearchControls;
33  import javax.naming.directory.SearchResult;
34  
35  /**
36   * <a href="DummyDirContext.java.html"><b><i>View Source</i></b></a>
37   *
38   * @author Brian Wing Shun Chan
39   */
40  public class DummyDirContext extends DummyContext implements DirContext {
41  
42      public void bind(Name name, Object obj, Attributes attrs)
43          throws NamingException {
44  
45          throw new OperationNotSupportedException();
46      }
47  
48      public void bind(String name, Object obj, Attributes attrs)
49          throws NamingException {
50  
51          throw new OperationNotSupportedException();
52      }
53  
54      public DirContext createSubcontext(Name name, Attributes attrs)
55          throws NamingException {
56  
57          throw new OperationNotSupportedException();
58      }
59  
60      public DirContext createSubcontext(String name, Attributes attrs)
61          throws NamingException {
62  
63          throw new OperationNotSupportedException();
64      }
65  
66      public Attributes getAttributes(Name name) throws NamingException {
67          throw new OperationNotSupportedException();
68      }
69  
70      public Attributes getAttributes(String name) throws NamingException {
71          throw new OperationNotSupportedException();
72      }
73  
74      public Attributes getAttributes(Name name, String[] attrIds)
75          throws NamingException {
76  
77          throw new OperationNotSupportedException();
78      }
79  
80      public Attributes getAttributes(String name, String[] attrIds)
81          throws NamingException {
82  
83          throw new OperationNotSupportedException();
84      }
85  
86      public DirContext getSchema(Name name) throws NamingException {
87          throw new OperationNotSupportedException();
88      }
89  
90      public DirContext getSchema(String name) throws NamingException {
91          throw new OperationNotSupportedException();
92      }
93  
94      public DirContext getSchemaClassDefinition(Name name)
95          throws NamingException {
96  
97          throw new OperationNotSupportedException();
98      }
99  
100     public DirContext getSchemaClassDefinition(String name)
101         throws NamingException {
102 
103         throw new OperationNotSupportedException();
104     }
105 
106     public void modifyAttributes(
107             Name name, int modificationOp, Attributes attrs)
108         throws NamingException {
109 
110         throw new OperationNotSupportedException();
111     }
112 
113     public void modifyAttributes(
114             String name, int modificationOp, Attributes attrs)
115         throws NamingException {
116 
117         throw new OperationNotSupportedException();
118     }
119 
120     public void modifyAttributes(Name name, ModificationItem[] mods)
121         throws NamingException {
122 
123         throw new OperationNotSupportedException();
124     }
125 
126     public void modifyAttributes(String name, ModificationItem[] mods)
127         throws NamingException {
128 
129         throw new OperationNotSupportedException();
130     }
131 
132     public void rebind(Name name, Object obj, Attributes attrs)
133         throws NamingException {
134 
135         throw new OperationNotSupportedException();
136     }
137 
138     public void rebind(String name, Object obj, Attributes attrs)
139         throws NamingException {
140 
141         throw new OperationNotSupportedException();
142     }
143 
144     public NamingEnumeration<SearchResult> search(
145             Name name, Attributes matchingAttributes,
146             String[] attributesToReturn)
147         throws NamingException {
148 
149         throw new OperationNotSupportedException();
150     }
151 
152     public NamingEnumeration<SearchResult> search(
153             String name, Attributes matchingAttributes,
154             String[] attributesToReturn)
155         throws NamingException {
156 
157         throw new OperationNotSupportedException();
158     }
159 
160     public NamingEnumeration<SearchResult> search(
161             Name name, Attributes matchingAttributes)
162         throws NamingException {
163 
164         throw new OperationNotSupportedException();
165     }
166 
167     public NamingEnumeration<SearchResult> search(
168             String name, Attributes matchingAttributes)
169         throws NamingException {
170 
171         throw new OperationNotSupportedException();
172     }
173 
174     public NamingEnumeration<SearchResult> search(
175             Name name, String filter, SearchControls cons)
176         throws NamingException {
177 
178         throw new OperationNotSupportedException();
179     }
180 
181     public NamingEnumeration<SearchResult> search(
182             String name, String filter, SearchControls cons)
183         throws NamingException {
184 
185         throw new OperationNotSupportedException();
186     }
187 
188     public NamingEnumeration<SearchResult> search(
189             Name name, String filterExpr, Object[] filterArgs,
190             SearchControls cons)
191         throws NamingException {
192 
193         throw new OperationNotSupportedException();
194     }
195 
196     public NamingEnumeration<SearchResult> search(
197             String name, String filterExpr, Object[] filterArgs,
198             SearchControls cons)
199         throws NamingException {
200 
201         throw new OperationNotSupportedException();
202     }
203 
204 }