Package com.isode.dsapi
Class Referral
- java.lang.Object
-
- com.isode.dsapi.Referral
-
- All Implemented Interfaces:
java.lang.Iterable<ReferralAddress>
public class Referral extends java.lang.Object implements java.lang.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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addReferralAddress(ReferralAddress address)
This method is called by the ReferralAddress object to add itself to the list.int
getAddressCount()
Return a count of the set of addresses contained in the referral.ReferralAddress
getReferralAddress(int index)
Return a specific ReferralAddress from the ReferralDN
getTargetDN()
Return the target DN of the referraljava.util.Iterator<ReferralAddress>
iterator()
Returns an iterator over the addresses in this Referraljava.lang.String
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.
-
-
-
Constructor Detail
-
Referral
public Referral(DN targetDN)
This constructor is called from JNI and is not typically useful for other clients.- Parameters:
targetDN
- the target of the referral
-
-
Method Detail
-
addReferralAddress
protected void addReferralAddress(ReferralAddress address)
This method is called by the ReferralAddress object to add itself to the list.- Parameters:
address
- address to add
-
iterator
public java.util.Iterator<ReferralAddress> iterator()
Returns an iterator over the addresses in this Referral- Specified by:
iterator
in interfacejava.lang.Iterable<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
public ReferralAddress getReferralAddress(int index) throws java.lang.ArrayIndexOutOfBoundsException
Return a specific ReferralAddress from the Referral- Parameters:
index
- the index of the ReferralAddress to be returned (starting from zero)- Returns:
- a ReferralAddress
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- if index is greater than or equal to the value returned by getAddressCount().
-
getTargetDN
public DN getTargetDN()
Return the target DN of the referral- Returns:
- the referral's target DN.
-
toString
public java.lang.String 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.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String containing information about the referral or reference.
-
-