001    /**
002     * Copyright (c) 2000-2013 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 java.util.Hashtable;
018    
019    import javax.naming.Binding;
020    import javax.naming.Context;
021    import javax.naming.Name;
022    import javax.naming.NameClassPair;
023    import javax.naming.NameParser;
024    import javax.naming.NamingEnumeration;
025    import javax.naming.NamingException;
026    import javax.naming.OperationNotSupportedException;
027    
028    /**
029     * @author Brian Wing Shun Chan
030     */
031    public class DummyContext implements Context {
032    
033            @Override
034            public Object addToEnvironment(String propName, Object propVal)
035                    throws NamingException {
036    
037                    throw new OperationNotSupportedException();
038            }
039    
040            @Override
041            public void bind(Name name, Object obj) throws NamingException {
042                    throw new OperationNotSupportedException();
043            }
044    
045            @Override
046            public void bind(String name, Object obj) throws NamingException {
047                    throw new OperationNotSupportedException();
048            }
049    
050            @Override
051            public void close() throws NamingException {
052                    throw new OperationNotSupportedException();
053            }
054    
055            @Override
056            public Name composeName(Name name, Name prefix) throws NamingException {
057                    throw new OperationNotSupportedException();
058            }
059    
060            @Override
061            public String composeName(String name, String prefix)
062                    throws NamingException {
063    
064                    throw new OperationNotSupportedException();
065            }
066    
067            @Override
068            public Context createSubcontext(Name name) throws NamingException {
069                    throw new OperationNotSupportedException();
070            }
071    
072            @Override
073            public Context createSubcontext(String name) throws NamingException {
074                    throw new OperationNotSupportedException();
075            }
076    
077            @Override
078            public void destroySubcontext(Name name) throws NamingException {
079                    throw new OperationNotSupportedException();
080            }
081    
082            @Override
083            public void destroySubcontext(String name) throws NamingException {
084                    throw new OperationNotSupportedException();
085            }
086    
087            @Override
088            public Hashtable<?, ?> getEnvironment() throws NamingException {
089                    throw new OperationNotSupportedException();
090            }
091    
092            @Override
093            public String getNameInNamespace() throws NamingException {
094                    throw new OperationNotSupportedException();
095            }
096    
097            @Override
098            public NameParser getNameParser(Name name) throws NamingException {
099                    throw new OperationNotSupportedException();
100            }
101    
102            @Override
103            public NameParser getNameParser(String name) throws NamingException {
104                    throw new OperationNotSupportedException();
105            }
106    
107            @Override
108            public NamingEnumeration<NameClassPair> list(Name name)
109                    throws NamingException {
110    
111                    throw new OperationNotSupportedException();
112            }
113    
114            @Override
115            public NamingEnumeration<NameClassPair> list(String name)
116                    throws NamingException {
117    
118                    throw new OperationNotSupportedException();
119            }
120    
121            @Override
122            public NamingEnumeration<Binding> listBindings(Name name)
123                    throws NamingException {
124    
125                    throw new OperationNotSupportedException();
126            }
127    
128            @Override
129            public NamingEnumeration<Binding> listBindings(String name)
130                    throws NamingException {
131    
132                    throw new OperationNotSupportedException();
133            }
134    
135            @Override
136            public Object lookup(Name name) throws NamingException {
137                    throw new OperationNotSupportedException();
138            }
139    
140            @Override
141            public Object lookup(String name) throws NamingException {
142                    throw new OperationNotSupportedException();
143            }
144    
145            @Override
146            public Object lookupLink(Name name) throws NamingException {
147                    throw new OperationNotSupportedException();
148            }
149    
150            @Override
151            public Object lookupLink(String name) throws NamingException {
152                    throw new OperationNotSupportedException();
153            }
154    
155            @Override
156            public void rebind(Name name, Object obj) throws NamingException {
157                    throw new OperationNotSupportedException();
158            }
159    
160            @Override
161            public void rebind(String name, Object obj) throws NamingException {
162                    throw new OperationNotSupportedException();
163            }
164    
165            @Override
166            public Object removeFromEnvironment(String propName)
167                    throws NamingException {
168    
169                    throw new OperationNotSupportedException();
170            }
171    
172            @Override
173            public void rename(Name oldName, Name newName) throws NamingException {
174                    throw new OperationNotSupportedException();
175            }
176    
177            @Override
178            public void rename(String oldName, String newName) throws NamingException {
179                    throw new OperationNotSupportedException();
180            }
181    
182            @Override
183            public void unbind(Name name) throws NamingException {
184                    throw new OperationNotSupportedException();
185            }
186    
187            @Override
188            public void unbind(String name) throws NamingException {
189                    throw new OperationNotSupportedException();
190            }
191    
192    }