APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jndi.ldap

public final Class LdapReferralException

extends LdapReferralException
Class Inheritance
Imports
javax.naming.*, javax.naming.ldap.Control, java.util.Hashtable, .Vector

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 it is throw once processing has completed.

Author
Vincent Ryan

Field Summary

Modifier and TypeField and Description
private boolean
private Hashtable<?, ?>
private NamingException
private boolean
private int
private int
private String
private String
pack-priv LdapReferralException
private int
private int
private Vector<?>
private Control[]
private static final long
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
LdapReferralException(Name
The part of the name that has been successfully resolved.
resolvedName
,
Object
The object to which resolution was successful.
resolvedObj
,
Name
The remaining unresolved portion of the name.
remainingName
,
String
Additional detail about this exception.
explanation
,
Hashtable<?, ?> envprops, String nextName, int handleReferrals, Control[] reqCtls)

Constructs a new instance of LdapReferralException.

Method Summary

Modifier and TypeMethod and Description
pack-priv LdapReferralException
appendUnprocessedReferrals(LdapReferralException back)

Appends the supplied (chain of) referral exception onto the end of the current (chain of) referral exception.

pack-priv void
dump()

Display the state of each element in a chain of LdapReferralException objects.

private void
dumpState()

Display the state of this LdapReferralException object.

pack-priv NamingException
getNamingException()

Gets the exception generated while processing a referral.

pack-priv String
getNewRdn()

Gets the new RDN name.

pack-priv String
getNextReferral()

Gets the next referral.

public Context
getReferralContext()

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

Gets a context at which to continue processing.

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

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

Gets a context at which to continue processing.

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

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

Gets a context at which to continue processing.

public Object
getReferralInfo()

Implements abstract javax.naming.ReferralException.getReferralInfo.

Gets referral information.

pack-priv boolean
hasMoreReferralExceptions()

Tests if there are any referral exceptions remaining to be processed.

pack-priv boolean
hasMoreReferrals()

Tests if there are any referrals remaining to be processed.

public void
retryReferral()

Implements abstract javax.naming.ReferralException.retryReferral.

Marks the current referral as one to be retried.

pack-priv void
setHopCount(int hopCount)

Sets the counter which records the number of hops that result from following a sequence of referrals.

pack-priv void
setNameResolved(boolean resolved)

Sets the flag to indicate that the target name has been resolved.

pack-priv void
setNamingException(NamingException e)

Sets the exception generated while processing a referral.

pack-priv void
setNewRdn(String newRdn)

Sets the new RDN name so that the rename operation can be completed (when a referral is being followed).

pack-priv void
setReferralInfo(Vector<?> referrals, boolean continuationRef)

Sets referral information.

public boolean
skipReferral()

Implements abstract javax.naming.ReferralException.skipReferral.

Marks the current referral as one to be ignored.

Field Detail

debugback to summary
private boolean debug
envpropsback to summary
private Hashtable<?, ?> envprops
errorExback to summary
private NamingException errorEx
foundEntryback to summary
private boolean foundEntry
handleReferralsback to summary
private int handleReferrals
hopCountback to summary
private int hopCount
newRdnback to summary
private String newRdn
nextNameback to summary
private String nextName
nextReferralExback to summary
pack-priv LdapReferralException nextReferralEx
referralCountback to summary
private int referralCount
referralIndexback to summary
private int referralIndex
referralsback to summary
private Vector<?> referrals
reqCtlsback to summary
private Control[] reqCtls
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.naming.ldap.LdapReferralException.serialVersionUID.

skipThisReferralback to summary
private boolean skipThisReferral

Constructor Detail

LdapReferralExceptionback to summary
pack-priv LdapReferralException(Name resolvedName, Object resolvedObj, Name remainingName, String explanation, Hashtable<?, ?> envprops, String nextName, int handleReferrals, Control[] reqCtls)

Constructs a new instance of LdapReferralException.

Parameters
resolvedName:Name

The part of the name that has been successfully resolved.

resolvedObj:Object

The object to which resolution was successful.

remainingName:Name

The remaining unresolved portion of the name.

explanation:String

Additional detail about this exception.

Method Detail

appendUnprocessedReferralsback to summary
pack-priv LdapReferralException appendUnprocessedReferrals(LdapReferralException back)

Appends the supplied (chain of) referral exception onto the end of the current (chain of) referral exception. Spent referral exceptions are trimmed off.

dumpback to summary
pack-priv void dump()

Display the state of each element in a chain of LdapReferralException objects.

dumpStateback to summary
private void dumpState()

Display the state of this LdapReferralException object.

getNamingExceptionback to summary
pack-priv NamingException getNamingException()

Gets the exception generated while processing a referral.

getNewRdnback to summary
pack-priv String getNewRdn()

Gets the new RDN name.

getNextReferralback to summary
pack-priv String getNextReferral() throws ReferralException

Gets the next referral. When the current set of referrals have been exhausted then the next referral exception is thrown, if available.

getReferralContextback to summary
public Context getReferralContext() throws NamingException

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

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

Exceptions
NamingException:

Doc from javax.naming.ldap.LdapReferralException.getReferralContext.

If a naming exception was encountered. Call either retryReferral() or skipReferral() to continue processing referrals.

getReferralContextback to summary
public Context getReferralContext(Hashtable<?, ?> newProps) throws NamingException

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

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

Exceptions
NamingException:

Doc from javax.naming.ldap.LdapReferralException.getReferralContext.

If a naming exception was encountered. Call either retryReferral() or skipReferral() to continue processing referrals.

getReferralContextback to summary
public Context getReferralContext(Hashtable<?, ?> newProps, Control[] connCtls) throws NamingException

Implements abstract javax.naming.ldap.LdapReferralException.getReferralContext.

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

Exceptions
NamingException:

Doc from javax.naming.ldap.LdapReferralException.getReferralContext.

If a naming exception was encountered. Call either retryReferral() or skipReferral() to continue processing referrals.

getReferralInfoback to summary
public Object getReferralInfo()

Implements abstract javax.naming.ReferralException.getReferralInfo.

Gets referral information.

hasMoreReferralExceptionsback to summary
pack-priv boolean hasMoreReferralExceptions()

Tests if there are any referral exceptions remaining to be processed.

hasMoreReferralsback to summary
pack-priv boolean hasMoreReferrals()

Tests if there are any referrals remaining to be processed. If name resolution has already completed then any remaining referrals (in the current referral exception) will be ignored.

retryReferralback to summary
public void retryReferral()

Implements abstract javax.naming.ReferralException.retryReferral.

Marks the current referral as one to be retried.

setHopCountback to summary
pack-priv void setHopCount(int hopCount)

Sets the counter which records the number of hops that result from following a sequence of referrals.

setNameResolvedback to summary
pack-priv void setNameResolved(boolean resolved)

Sets the flag to indicate that the target name has been resolved.

setNamingExceptionback to summary
pack-priv void setNamingException(NamingException e)

Sets the exception generated while processing a referral. Only the first exception is recorded.

setNewRdnback to summary
pack-priv void setNewRdn(String newRdn)

Sets the new RDN name so that the rename operation can be completed (when a referral is being followed).

setReferralInfoback to summary
pack-priv void setReferralInfo(Vector<?> referrals, boolean continuationRef)

Sets referral information.

skipReferralback to summary
public boolean skipReferral()

Implements abstract javax.naming.ReferralException.skipReferral.

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