Package org.ldaptive

Class SearchResultReference

java.lang.Object
org.ldaptive.AbstractMessage
org.ldaptive.SearchResultReference
All Implemented Interfaces:
Freezable, Message

public final class SearchResultReference extends AbstractMessage implements Freezable
LDAP search result entry defined as:
   SearchResultReference ::= [APPLICATION 19] SEQUENCE
     SIZE (1..MAX) OF uri URI
 
  • Field Details

    • PROTOCOL_OP

      public static final int PROTOCOL_OP
      BER protocol number.
      See Also:
    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • REFERRAL_URI_PATH

      private static final DERPath REFERRAL_URI_PATH
      DER path to referral URI.
    • references

      private final List<String> references
      List of references.
    • immutable

      private volatile boolean immutable
      Whether this object has been marked immutable.
  • Constructor Details

    • SearchResultReference

      public SearchResultReference()
      Default constructor.
    • SearchResultReference

      public SearchResultReference(DERBuffer buffer)
      Creates a new search result reference.
      Parameters:
      buffer - to decode
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Freezable
      Freezes this object, making it immutable.
      Specified by:
      freeze in interface Freezable
    • isFrozen

      public boolean isFrozen()
      Description copied from interface: Freezable
      Determines whether this object is frozen, i.e. immutable.
      Specified by:
      isFrozen in interface Freezable
      Returns:
      True if Freezable.freeze() has been invoked, false otherwise.
    • assertMutable

      public void assertMutable()
      Description copied from interface: Freezable
      Asserts that this object is in a state to permit mutations. Classes that implement this interface should invoke this method prior to performing any mutation of internal state as a means of implementing the "frozen" usage contract.
      Specified by:
      assertMutable in interface Freezable
    • getUris

      public String[] getUris()
      Returns the URIs in this reference.
      Returns:
      reference URIs
    • addUris

      public void addUris(String... uri)
      Adds a new URI to this reference.
      Parameters:
      uri - to add
    • addUris

      public void addUris(Collection<String> uris)
      Adds a new URI to this reference.
      Parameters:
      uris - to add
    • removeUris

      public void removeUris(String... uri)
      Removes a URI from this reference.
      Parameters:
      uri - to remove
    • removeUris

      public void removeUris(Collection<String> uris)
      Removes a URI from this reference.
      Parameters:
      uris - to remove
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractMessage
    • hashCode

      public int hashCode()
      Description copied from class: AbstractMessage
      Returns the hash code for this object.
      Specified by:
      hashCode in class AbstractMessage
      Returns:
      hash code
    • toString

      public String toString()
      Overrides:
      toString in class AbstractMessage
    • copy

      public static SearchResultReference copy(SearchResultReference ref)
      Creates a mutable copy of the supplied search result reference.
      Parameters:
      ref - to copy
      Returns:
      new search result reference instance
    • sort

      public static SearchResultReference sort(SearchResultReference ref)
      Returns a new reference whose URIs are sorted naturally.
      Parameters:
      ref - reference to sort
      Returns:
      sorted reference
    • builder

      public static SearchResultReference.Builder builder()
      Creates a builder for this class.
      Returns:
      new builder