001    /**
002     * Copyright (c) 2000-2010 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.util.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(String name) throws NamingException {
061                    throw new OperationNotSupportedException();
062            }
063    
064            public Attributes getAttributes(Name name, String[] attrIds)
065                    throws NamingException {
066    
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(
104                            String name, int modificationOp, Attributes attrs)
105                    throws NamingException {
106    
107                    throw new OperationNotSupportedException();
108            }
109    
110            public void modifyAttributes(Name name, ModificationItem[] mods)
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                            String[] attributesToReturn)
137                    throws NamingException {
138    
139                    throw new OperationNotSupportedException();
140            }
141    
142            public NamingEnumeration<SearchResult> search(
143                            String name, Attributes matchingAttributes,
144                            String[] attributesToReturn)
145                    throws NamingException {
146    
147                    throw new OperationNotSupportedException();
148            }
149    
150            public NamingEnumeration<SearchResult> search(
151                            Name name, Attributes matchingAttributes)
152                    throws NamingException {
153    
154                    throw new OperationNotSupportedException();
155            }
156    
157            public NamingEnumeration<SearchResult> search(
158                            String name, Attributes matchingAttributes)
159                    throws NamingException {
160    
161                    throw new OperationNotSupportedException();
162            }
163    
164            public NamingEnumeration<SearchResult> search(
165                            Name name, String filter, SearchControls cons)
166                    throws NamingException {
167    
168                    throw new OperationNotSupportedException();
169            }
170    
171            public NamingEnumeration<SearchResult> search(
172                            String name, String filter, SearchControls cons)
173                    throws NamingException {
174    
175                    throw new OperationNotSupportedException();
176            }
177    
178            public NamingEnumeration<SearchResult> search(
179                            Name name, String filterExpr, Object[] filterArgs,
180                            SearchControls cons)
181                    throws NamingException {
182    
183                    throw new OperationNotSupportedException();
184            }
185    
186            public NamingEnumeration<SearchResult> search(
187                            String name, String filterExpr, Object[] filterArgs,
188                            SearchControls cons)
189                    throws NamingException {
190    
191                    throw new OperationNotSupportedException();
192            }
193    
194    }