Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      Referral​(DN targetDN)
      This constructor is called from JNI and is not typically useful for other clients.
    • 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 Referral
      DN getTargetDN()
      Return the target DN of the referral
      java.util.Iterator<ReferralAddress> iterator()
      Returns an iterator over the addresses in this Referral
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • 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 interface java.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 class java.lang.Object
        Returns:
        a String containing information about the referral or reference.