001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.ldap;
016    
017    import javax.naming.Name;
018    import javax.naming.NamingEnumeration;
019    import javax.naming.NamingException;
020    import javax.naming.OperationNotSupportedException;
021    import javax.naming.directory.Attributes;
022    import javax.naming.directory.DirContext;
023    import javax.naming.directory.ModificationItem;
024    import javax.naming.directory.SearchControls;
025    import javax.naming.directory.SearchResult;
026    
027    /**
028     * @author Brian Wing Shun Chan
029     */
030    public class DummyDirContext extends DummyContext implements DirContext {
031    
032            public void bind(Name name, Object obj, Attributes attrs)
033                    throws NamingException {
034    
035                    throw new OperationNotSupportedException();
036            }
037    
038            public void bind(String name, Object obj, Attributes attrs)
039                    throws NamingException {
040    
041                    throw new OperationNotSupportedException();
042            }
043    
044            public DirContext createSubcontext(Name name, Attributes attrs)
045                    throws NamingException {
046    
047                    throw new OperationNotSupportedException();
048            }
049    
050            public DirContext createSubcontext(String name, Attributes attrs)
051                    throws NamingException {
052    
053                    throw new OperationNotSupportedException();
054            }
055    
056            public Attributes getAttributes(Name name) throws NamingException {
057                    throw new OperationNotSupportedException();
058            }
059    
060            public Attributes getAttributes(Name name, String[] attrIds)
061                    throws NamingException {
062    
063                    throw new OperationNotSupportedException();
064            }
065    
066            public Attributes getAttributes(String name) throws NamingException {
067                    throw new OperationNotSupportedException();
068            }
069    
070            public Attributes getAttributes(String name, String[] attrIds)
071                    throws NamingException {
072    
073                    throw new OperationNotSupportedException();
074            }
075    
076            public DirContext getSchema(Name name) throws NamingException {
077                    throw new OperationNotSupportedException();
078            }
079    
080            public DirContext getSchema(String name) throws NamingException {
081                    throw new OperationNotSupportedException();
082            }
083    
084            public DirContext getSchemaClassDefinition(Name name)
085                    throws NamingException {
086    
087                    throw new OperationNotSupportedException();
088            }
089    
090            public DirContext getSchemaClassDefinition(String name)
091                    throws NamingException {
092    
093                    throw new OperationNotSupportedException();
094            }
095    
096            public void modifyAttributes(
097                            Name name, int modificationOp, Attributes attrs)
098                    throws NamingException {
099    
100                    throw new OperationNotSupportedException();
101            }
102    
103            public void modifyAttributes(Name name, ModificationItem[] mods)
104                    throws NamingException {
105    
106                    throw new OperationNotSupportedException();
107            }
108    
109            public void modifyAttributes(
110                            String name, int modificationOp, Attributes attrs)
111                    throws NamingException {
112    
113                    throw new OperationNotSupportedException();
114            }
115    
116            public void modifyAttributes(String name, ModificationItem[] mods)
117                    throws NamingException {
118    
119                    throw new OperationNotSupportedException();
120            }
121    
122            public void rebind(Name name, Object obj, Attributes attrs)
123                    throws NamingException {
124    
125                    throw new OperationNotSupportedException();
126            }
127    
128            public void rebind(String name, Object obj, Attributes attrs)
129                    throws NamingException {
130    
131                    throw new OperationNotSupportedException();
132            }
133    
134            public NamingEnumeration<SearchResult> search(
135                            Name name, Attributes matchingAttributes)
136                    throws NamingException {
137    
138                    throw new OperationNotSupportedException();
139            }
140    
141            public NamingEnumeration<SearchResult> search(
142                            Name name, Attributes matchingAttributes,
143                            String[] attributesToReturn)
144                    throws NamingException {
145    
146                    throw new OperationNotSupportedException();
147            }
148    
149            public NamingEnumeration<SearchResult> search(
150                            Name name, String filterExpr, Object[] filterArgs,
151                            SearchControls cons)
152                    throws NamingException {
153    
154                    throw new OperationNotSupportedException();
155            }
156    
157            public NamingEnumeration<SearchResult> search(
158                            Name name, String filter, SearchControls cons)
159                    throws NamingException {
160    
161                    throw new OperationNotSupportedException();
162            }
163    
164            public NamingEnumeration<SearchResult> search(
165                            String name, Attributes matchingAttributes)
166                    throws NamingException {
167    
168                    throw new OperationNotSupportedException();
169            }
170    
171            public NamingEnumeration<SearchResult> search(
172                            String name, Attributes matchingAttributes,
173                            String[] attributesToReturn)
174                    throws NamingException {
175    
176                    throw new OperationNotSupportedException();
177            }
178    
179            public NamingEnumeration<SearchResult> search(
180                            String name, String filterExpr, Object[] filterArgs,
181                            SearchControls cons)
182                    throws NamingException {
183    
184                    throw new OperationNotSupportedException();
185            }
186    
187            public NamingEnumeration<SearchResult> search(
188                            String name, String filter, SearchControls cons)
189                    throws NamingException {
190    
191                    throw new OperationNotSupportedException();
192            }
193    
194    }