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 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            public Object addToEnvironment(String propName, Object propVal)
034                    throws NamingException {
035    
036                    throw new OperationNotSupportedException();
037            }
038    
039            public void bind(Name name, Object obj) throws NamingException {
040                    throw new OperationNotSupportedException();
041            }
042    
043            public void bind(String name, Object obj) throws NamingException {
044                    throw new OperationNotSupportedException();
045            }
046    
047            public void close() throws NamingException {
048                    throw new OperationNotSupportedException();
049            }
050    
051            public Name composeName(Name name, Name prefix) throws NamingException {
052                    throw new OperationNotSupportedException();
053            }
054    
055            public String composeName(String name, String prefix)
056                    throws NamingException {
057    
058                    throw new OperationNotSupportedException();
059            }
060    
061            public Context createSubcontext(Name name) throws NamingException {
062                    throw new OperationNotSupportedException();
063            }
064    
065            public Context createSubcontext(String name) throws NamingException {
066                    throw new OperationNotSupportedException();
067            }
068    
069            public void destroySubcontext(Name name) throws NamingException {
070                    throw new OperationNotSupportedException();
071            }
072    
073            public void destroySubcontext(String name) throws NamingException {
074                    throw new OperationNotSupportedException();
075            }
076    
077            public Hashtable<?, ?> getEnvironment() throws NamingException {
078                    throw new OperationNotSupportedException();
079            }
080    
081            public String getNameInNamespace() throws NamingException {
082                    throw new OperationNotSupportedException();
083            }
084    
085            public NameParser getNameParser(Name name) throws NamingException {
086                    throw new OperationNotSupportedException();
087            }
088    
089            public NameParser getNameParser(String name) throws NamingException {
090                    throw new OperationNotSupportedException();
091            }
092    
093            public NamingEnumeration<NameClassPair> list(Name name)
094                    throws NamingException {
095    
096                    throw new OperationNotSupportedException();
097            }
098    
099            public NamingEnumeration<NameClassPair> list(String name)
100                    throws NamingException {
101    
102                    throw new OperationNotSupportedException();
103            }
104    
105            public NamingEnumeration<Binding> listBindings(Name name)
106                    throws NamingException {
107    
108                    throw new OperationNotSupportedException();
109            }
110    
111            public NamingEnumeration<Binding> listBindings(String name)
112                    throws NamingException {
113    
114                    throw new OperationNotSupportedException();
115            }
116    
117            public Object lookup(Name name) throws NamingException {
118                    throw new OperationNotSupportedException();
119            }
120    
121            public Object lookup(String name) throws NamingException {
122                    throw new OperationNotSupportedException();
123            }
124    
125            public Object lookupLink(Name name) throws NamingException {
126                    throw new OperationNotSupportedException();
127            }
128    
129            public Object lookupLink(String name) throws NamingException {
130                    throw new OperationNotSupportedException();
131            }
132    
133            public void rebind(Name name, Object obj) throws NamingException {
134                    throw new OperationNotSupportedException();
135            }
136    
137            public void rebind(String name, Object obj) throws NamingException {
138                    throw new OperationNotSupportedException();
139            }
140    
141            public Object removeFromEnvironment(String propName)
142                    throws NamingException {
143    
144                    throw new OperationNotSupportedException();
145            }
146    
147            public void rename(Name oldName, Name newName) throws NamingException {
148                    throw new OperationNotSupportedException();
149            }
150    
151            public void rename(String oldName, String newName)
152                    throws NamingException {
153    
154                    throw new OperationNotSupportedException();
155            }
156    
157            public void unbind(Name name) throws NamingException {
158                    throw new OperationNotSupportedException();
159            }
160    
161            public void unbind(String name) throws NamingException {
162                    throw new OperationNotSupportedException();
163            }
164    
165    }