0N/A/*
2362N/A * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.naming.ldap;
0N/A
0N/Aimport javax.naming.ReferralException;
0N/Aimport javax.naming.Context;
0N/Aimport javax.naming.NamingException;
0N/Aimport java.util.Hashtable;
0N/A
0N/A/**
0N/A * This abstract class is used to represent an LDAP referral exception.
0N/A * It extends the base <tt>ReferralException</tt> by providing a
0N/A * <tt>getReferralContext()</tt> method that accepts request controls.
0N/A * LdapReferralException is an abstract class. Concrete implementations of it
0N/A * determine its synchronization and serialization properties.
0N/A *<p>
0N/A * A <tt>Control[]</tt> array passed as a parameter to
0N/A * the <tt>getReferralContext()</tt> method is owned by the caller.
0N/A * The service provider will not modify the array or keep a reference to it,
0N/A * although it may keep references to the individual <tt>Control</tt> objects
0N/A * in the array.
0N/A *
0N/A * @author Rosanna Lee
0N/A * @author Scott Seligman
0N/A * @author Vincent Ryan
0N/A * @since 1.3
0N/A */
0N/A
0N/Apublic abstract class LdapReferralException extends ReferralException {
0N/A /**
0N/A * Constructs a new instance of LdapReferralException using the
0N/A * explanation supplied. All other fields are set to null.
0N/A *
0N/A * @param explanation Additional detail about this exception. Can be null.
0N/A * @see java.lang.Throwable#getMessage
0N/A */
0N/A protected LdapReferralException(String explanation) {
0N/A super(explanation);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a new instance of LdapReferralException.
0N/A * All fields are set to null.
0N/A */
0N/A protected LdapReferralException() {
0N/A super();
0N/A }
0N/A
0N/A /**
0N/A * Retrieves the context at which to continue the method using the
0N/A * context's environment and no controls.
0N/A * The referral context is created using the environment properties of
0N/A * the context that threw the <tt>ReferralException</tt> and no controls.
0N/A *<p>
0N/A * This method is equivalent to
0N/A *<blockquote><pre>
0N/A * getReferralContext(ctx.getEnvironment(), null);
0N/A *</pre></blockquote>
0N/A * where <tt>ctx</tt> is the context that threw the <tt>ReferralException.</tt>
0N/A *<p>
0N/A * It is overridden in this class for documentation purposes only.
0N/A * See <tt>ReferralException</tt> for how to use this method.
0N/A *
0N/A * @return The non-null context at which to continue the method.
0N/A * @exception NamingException If a naming exception was encountered.
0N/A * Call either <tt>retryReferral()</tt> or <tt>skipReferral()</tt>
0N/A * to continue processing referrals.
0N/A */
0N/A public abstract Context getReferralContext() throws NamingException;
0N/A
0N/A /**
0N/A * Retrieves the context at which to continue the method using
0N/A * environment properties and no controls.
0N/A * The referral context is created using <tt>env</tt> as its environment
0N/A * properties and no controls.
0N/A *<p>
0N/A * This method is equivalent to
0N/A *<blockquote><pre>
0N/A * getReferralContext(env, null);
0N/A *</pre></blockquote>
0N/A *<p>
0N/A * It is overridden in this class for documentation purposes only.
0N/A * See <tt>ReferralException</tt> for how to use this method.
0N/A *
0N/A * @param env The possibly null environment to use when retrieving the
0N/A * referral context. If null, no environment properties will be used.
0N/A *
0N/A * @return The non-null context at which to continue the method.
0N/A * @exception NamingException If a naming exception was encountered.
0N/A * Call either <tt>retryReferral()</tt> or <tt>skipReferral()</tt>
0N/A * to continue processing referrals.
0N/A */
0N/A public abstract Context
0N/A getReferralContext(Hashtable<?,?> env)
0N/A throws NamingException;
0N/A
0N/A /**
0N/A * Retrieves the context at which to continue the method using
0N/A * request controls and environment properties.
0N/A * Regardless of whether a referral is encountered directly during a
0N/A * context operation, or indirectly, for example, during a search
0N/A * enumeration, the referral exception should provide a context
0N/A * at which to continue the operation.
0N/A * To continue the operation, the client program should re-invoke
0N/A * the method using the same arguments as the original invocation.
0N/A *<p>
0N/A * <tt>reqCtls</tt> is used when creating the connection to the referred
0N/A * server. These controls will be used as the connection request controls for
0N/A * the context and context instances
0N/A * derived from the context.
0N/A * <tt>reqCtls</tt> will also be the context's request controls for
0N/A * subsequent context operations. See the <tt>LdapContext</tt> class
0N/A * description for details.
0N/A *<p>
0N/A * This method should be used instead of the other two overloaded forms
0N/A * when the caller needs to supply request controls for creating
0N/A * the referral context. It might need to do this, for example, when
0N/A * it needs to supply special controls relating to authentication.
0N/A *<p>
0N/A * Service provider implementors should read the "Service Provider" section
0N/A * in the <tt>LdapContext</tt> class description for implementation details.
0N/A *
0N/A * @param reqCtls The possibly null request controls to use for the new context.
0N/A * If null or the empty array means use no request controls.
0N/A * @param env The possibly null environment properties to use when
0N/A * for the new context. If null, the context is initialized with no environment
0N/A * properties.
0N/A * @return The non-null context at which to continue the method.
0N/A * @exception NamingException If a naming exception was encountered.
0N/A * Call either <tt>retryReferral()</tt> or <tt>skipReferral()</tt>
0N/A * to continue processing referrals.
0N/A */
0N/A public abstract Context
0N/A getReferralContext(Hashtable<?,?> env,
0N/A Control[] reqCtls)
0N/A throws NamingException;
0N/A
0N/A private static final long serialVersionUID = -1668992791764950804L;
0N/A}