Package com.isode.dsapi
Class Referral
java.lang.Object
com.isode.dsapi.Referral
- All Implemented Interfaces:
Iterable<ReferralAddress>
Class representing information extracted from a referral error or a
continuation reference.
A directory operation may fail when the directory itself is unable or
unwilling to satisfy a request but it knows of other directories that
might. In this case, a ReferralException will be thrown, and the
Indication will contain a Referral object containing supplementary
information.
A Referral object is also used to represent any continuation
reference returned by a directory in response to a search operation.
The Indication for a search operation may contain zero or more Referral
objects representing each of the continuation references returned by
the directory.
Each Referral object contains the target DN of the object in
question, as well as alist of ReferralAddress objects, each of which
contains information about an alternate directory that may be able to
locate the object.
- Author:
- nh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddReferralAddress(ReferralAddress address) This method is called by the ReferralAddress object to add itself to the list.intReturn a count of the set of addresses contained in the referral.getReferralAddress(int index) Return a specific ReferralAddress from the ReferralReturn the target DN of the referraliterator()Returns an iterator over the addresses in this ReferraltoString()Returns a string containing information about this referral or continuation reference, containing the information the target DN and the suggested locations to resolve it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Referral
This constructor is called from JNI and is not typically useful for other clients.- Parameters:
targetDN- the target of the referral
-
-
Method Details
-
addReferralAddress
This method is called by the ReferralAddress object to add itself to the list.- Parameters:
address- address to add
-
iterator
Returns an iterator over the addresses in this Referral- Specified by:
iteratorin interfaceIterable<ReferralAddress>- Returns:
- an iterator that can be used to process all the addresses in this Referral
-
getAddressCount
public int getAddressCount()Return a count of the set of addresses contained in the referral.- Returns:
- the number of addresses in the referral
-
getReferralAddress
Return a specific ReferralAddress from the Referral- Parameters:
index- the index of the ReferralAddress to be returned (starting from zero)- Returns:
- a ReferralAddress
- Throws:
ArrayIndexOutOfBoundsException- if index is greater than or equal to the value returned by getAddressCount().
-
getTargetDN
Return the target DN of the referral- Returns:
- the referral's target DN.
-
toString
Returns a string containing information about this referral or continuation reference, containing the information the target DN and the suggested locations to resolve it.
-