Class Referral

java.lang.Object
com.isode.dsapi.Referral
All Implemented Interfaces:
Iterable<ReferralAddress>

public class Referral extends Object implements 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 Details

    • 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 Details

    • 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 Iterator<ReferralAddress> iterator()
      Returns an iterator over the addresses in this Referral
      Specified by:
      iterator in interface 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 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:
      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 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 class Object
      Returns:
      a String containing information about the referral or reference.