public final class

LdapReferralException

extends LdapReferralException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ javax.naming.NamingException
         ↳ javax.naming.ReferralException
           ↳ javax.naming.ldap.LdapReferralException
             ↳ com.sun.jndi.ldap.LdapReferralException

Class Overview

This exception is raised when a referral to an alternative context is encountered.

An LdapReferralException object contains one or more referrals. Each referral is an alternative location for the same target entry. For example, a referral may be an LDAP URL. The referrals are attempted in sequence until one is successful or all have failed. In the case of the latter then the exception generated by the final referral is recorded and presented later.

A referral may be skipped or may be retried. For example, in the case of an authentication error, a referral may be retried with different environment properties.

An LdapReferralException object may also contain a reference to a chain of unprocessed LdapReferralException objects. Once the current set of referrals have been exhausted and unprocessed LdapReferralException objects remain, then the LdapReferralException object referenced by the current object is thrown and the cycle continues.

If new LdapReferralException objects are generated while following an existing referral then these new objects are appended to the end of the chain of unprocessed LdapReferralException objects.

If an exception was recorded while processing a chain of LdapReferralException objects then is is throw once processing has completed.

Summary

[Expand]
Inherited Fields
From class javax.naming.NamingException
Public Methods
Context getReferralContext(Hashtable<?, ?> newProps)
Gets a context at which to continue processing.
Context getReferralContext()
Gets a context at which to continue processing.
Context getReferralContext(Hashtable<?, ?> newProps, Control[] connCtls)
Gets a context at which to continue processing.
Object getReferralInfo()
Gets referral information.
void retryReferral()
Marks the current referral as one to be retried.
boolean skipReferral()
Marks the current referral as one to be ignored.
[Expand]
Inherited Methods
From class javax.naming.ldap.LdapReferralException
From class javax.naming.ReferralException
From class javax.naming.NamingException
From class java.lang.Throwable
From class java.lang.Object

Public Methods

public Context getReferralContext (Hashtable<?, ?> newProps)

Gets a context at which to continue processing. The supplied environment properties are used.

Parameters
newProps The possibly null environment to use when retrieving the referral context. If null, no environment properties will be used.
Returns
  • The non-null context at which to continue the method.

public Context getReferralContext ()

Gets a context at which to continue processing. The current environment properties are re-used.

Returns
  • The non-null context at which to continue the method.

public Context getReferralContext (Hashtable<?, ?> newProps, Control[] connCtls)

Gets a context at which to continue processing. The supplied environment properties and connection controls are used.

Parameters
newProps The possibly null environment properties to use when for the new context. If null, the context is initialized with no environment properties.
connCtls The possibly null request controls to use for the new context. If null or the empty array means use no request controls.
Returns
  • The non-null context at which to continue the method.

public Object getReferralInfo ()

Gets referral information.

Returns
  • Non-null referral information related to this referral.

public void retryReferral ()

Marks the current referral as one to be retried.

public boolean skipReferral ()

Marks the current referral as one to be ignored. Returns false when there are no referrals remaining to be processed.

Returns
  • true If more referral processing is pending; false otherwise.