Package org.forgerock.opendj.io
Class LdapReader<R extends Asn1Reader>
- java.lang.Object
-
- org.forgerock.opendj.io.LdapReader<R>
-
- Type Parameters:
R
- The type of ASN.1 reader used for decoding elements.
public final class LdapReader<R extends Asn1Reader> extends Object
Reads LDAP messages from an underlying ASN.1 reader.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
getAsn1Reader()
Returns the ASN.1 reader from which LDAP messages will be read.boolean
hasMessageAvailable()
Returnstrue
if the next LDAP message can be read without blocking.LdapMessage
readLdapRequestMessage()
Reads the next LDAP request message from the underlying ASN.1 reader.LdapMessage
readLdapResponseMessage()
Reads the next LDAP response message from the underlying ASN.1 reader.
-
-
-
Method Detail
-
getAsn1Reader
public R getAsn1Reader()
Returns the ASN.1 reader from which LDAP messages will be read.- Returns:
- The ASN.1 reader from which LDAP messages will be read.
-
hasMessageAvailable
public boolean hasMessageAvailable() throws IOException
Returnstrue
if the next LDAP message can be read without blocking.- Returns:
true
if the next LDAP message can be read without blocking orfalse
otherwise.- 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 aRequest
. - 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 aResponse
. - Throws:
DecodeException
- If the available data was not a valid LDAP message.IOException
- If an unexpected IO error occurred.
-
-