Class LdapReader

java.lang.Object
org.forgerock.opendj.io.LdapReader

public final class LdapReader extends Object
Reads LDAP messages from an underlying ASN.1 reader.

Methods for creating LdapReaders are provided in the Ldap class.

  • Method Details

    • hasMessageAvailable

      public boolean hasMessageAvailable() throws IOException
      Returns true if the next LDAP message can be read without blocking.
      Returns:
      true if the next LDAP message can be read without blocking or false otherwise.
      Throws:
      DecodeException - If the available data was not a valid LDAP message.
      IOException - If an unexpected IO error occurred.
    • readLdapMessage

      public LdapMessage readLdapMessage() throws IOException
      Reads the next LDAP message from the underlying ASN.1 reader.
      Returns:
      A fully decoded LdapMessage.
      Throws:
      DecodeException - If the available data was not a valid LDAP message.
      IOException - If an unexpected IO error occurred.
    • readLdapRequestMessage

      public LdapMessage readLdapRequestMessage() throws IOException
      Reads the next LDAP request message from the underlying ASN.1 reader.
      Returns:
      A fully decoded LdapMessage wrapping a Request.
      Throws:
      DecodeException - If the available data was not a valid LDAP message.
      IOException - If an unexpected IO error occurred.
    • readLdapResponseMessage

      public LdapMessage readLdapResponseMessage() throws IOException
      Reads the next LDAP response message from the underlying ASN.1 reader.
      Returns:
      A fully decoded LdapMessage wrapping a Response.
      Throws:
      DecodeException - If the available data was not a valid LDAP message.
      IOException - If an unexpected IO error occurred.
    • readMinimalResponseMessage

      public LdapMessage readMinimalResponseMessage() throws IOException
      Reads the next LDAP response message from the underlying ASN.1 reader performing minimal decoding. This method is intended for use within performance tools in order to minimize unnecessary processing.
      Returns:
      A fully decoded LdapMessage wrapping a Response.
      Throws:
      DecodeException - If the available data was not a valid LDAP message.
      IOException - If an unexpected IO error occurred.