1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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  
34  /**
35   * <a href="DummyDirContext.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Brian Wing Shun Chan
38   *
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 search(
145             Name name, Attributes matchingAttributes,
146             String[] attributesToReturn)
147         throws NamingException {
148 
149         throw new OperationNotSupportedException();
150     }
151 
152     public NamingEnumeration search(
153             String name, Attributes matchingAttributes,
154             String[] attributesToReturn)
155         throws NamingException {
156 
157         throw new OperationNotSupportedException();
158     }
159 
160     public NamingEnumeration search(Name name, Attributes matchingAttributes)
161         throws NamingException {
162 
163         throw new OperationNotSupportedException();
164     }
165 
166     public NamingEnumeration search(String name, Attributes matchingAttributes)
167         throws NamingException {
168 
169         throw new OperationNotSupportedException();
170     }
171 
172     public NamingEnumeration search(
173             Name name, String filter, SearchControls cons)
174         throws NamingException {
175 
176         throw new OperationNotSupportedException();
177     }
178 
179     public NamingEnumeration search(
180             String name, String filter, SearchControls cons)
181         throws NamingException {
182 
183         throw new OperationNotSupportedException();
184     }
185 
186     public NamingEnumeration search(
187             Name name, String filterExpr, Object[] filterArgs,
188             SearchControls cons)
189         throws NamingException {
190 
191         throw new OperationNotSupportedException();
192     }
193 
194     public NamingEnumeration search(
195             String name, String filterExpr, Object[] filterArgs,
196             SearchControls cons)
197         throws NamingException {
198 
199         throw new OperationNotSupportedException();
200     }
201 
202 }