18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.jndi.ldap; 27 28 import javax.naming.*; 29 import javax.naming.ldap.Control; 30 31 import java.util.Hashtable; 32 import java.util.Vector; 33 34 /** 35 * This exception is raised when a referral to an alternative context 36 * is encountered. 37 * <p> 38 * An <tt>LdapReferralException</tt> object contains one or more referrals. 39 * Each referral is an alternative location for the same target entry. 40 * For example, a referral may be an LDAP URL. 41 * The referrals are attempted in sequence until one is successful or 42 * all have failed. In the case of the latter then the exception generated 43 * by the final referral is recorded and presented later. 44 * <p> 45 * A referral may be skipped or may be retried. For example, in the case 46 * of an authentication error, a referral may be retried with different 47 * environment properties. 48 * <p> 49 * An <tt>LdapReferralException</tt> object may also contain a reference 50 * to a chain of unprocessed <tt>LdapReferralException</tt> objects. 51 * Once the current set of referrals have been exhausted and unprocessed 52 * <tt>LdapReferralException</tt> objects remain, then the 53 * <tt>LdapReferralException</tt> object referenced by the current 54 * object is thrown and the cycle continues. 55 * <p> 56 * If new <tt>LdapReferralException</tt> objects are generated while 57 * following an existing referral then these new objects are appended 58 * to the end of the chain of unprocessed <tt>LdapReferralException</tt> 59 * objects. 60 * <p> 61 * If an exception was recorded while processing a chain of 62 * <tt>LdapReferralException</tt> objects then it is throw once 63 * processing has completed. 64 * 65 * @author Vincent Ryan 66 */ 67 final public class LdapReferralException extends 68 javax.naming.ldap.LdapReferralException { 69 private static final long serialVersionUID = 627059076356906399L; 70 71 // ----------- fields initialized in constructor --------------- 72 private int handleReferrals; 73 private Hashtable<?,?> envprops; 74 private String nextName; 75 private Control[] reqCtls; 76 77 // ----------- fields that have defaults ----------------------- 78 private Vector<?> referrals = null; // alternatives,set by setReferralInfo() 79 private int referralIndex = 0; // index into referrals 80 private int referralCount = 0; // count of referrals 81 private boolean foundEntry = false; // will stop when entry is found 82 private boolean skipThisReferral = false; | 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.jndi.ldap; 27 28 import javax.naming.*; 29 import javax.naming.ldap.Control; 30 31 import java.util.Hashtable; 32 import java.util.Vector; 33 34 /** 35 * This exception is raised when a referral to an alternative context 36 * is encountered. 37 * <p> 38 * An {@code LdapReferralException} object contains one or more referrals. 39 * Each referral is an alternative location for the same target entry. 40 * For example, a referral may be an LDAP URL. 41 * The referrals are attempted in sequence until one is successful or 42 * all have failed. In the case of the latter then the exception generated 43 * by the final referral is recorded and presented later. 44 * <p> 45 * A referral may be skipped or may be retried. For example, in the case 46 * of an authentication error, a referral may be retried with different 47 * environment properties. 48 * <p> 49 * An {@code LdapReferralException} object may also contain a reference 50 * to a chain of unprocessed {@code LdapReferralException} objects. 51 * Once the current set of referrals have been exhausted and unprocessed 52 * {@code LdapReferralException} objects remain, then the 53 * {@code LdapReferralException} object referenced by the current 54 * object is thrown and the cycle continues. 55 * <p> 56 * If new {@code LdapReferralException} objects are generated while 57 * following an existing referral then these new objects are appended 58 * to the end of the chain of unprocessed {@code LdapReferralException} 59 * objects. 60 * <p> 61 * If an exception was recorded while processing a chain of 62 * {@code LdapReferralException} objects then it is throw once 63 * processing has completed. 64 * 65 * @author Vincent Ryan 66 */ 67 final public class LdapReferralException extends 68 javax.naming.ldap.LdapReferralException { 69 private static final long serialVersionUID = 627059076356906399L; 70 71 // ----------- fields initialized in constructor --------------- 72 private int handleReferrals; 73 private Hashtable<?,?> envprops; 74 private String nextName; 75 private Control[] reqCtls; 76 77 // ----------- fields that have defaults ----------------------- 78 private Vector<?> referrals = null; // alternatives,set by setReferralInfo() 79 private int referralIndex = 0; // index into referrals 80 private int referralCount = 0; // count of referrals 81 private boolean foundEntry = false; // will stop when entry is found 82 private boolean skipThisReferral = false; |