Package org.opends.server.tools
Class LDAPReader
- java.lang.Object
-
- org.opends.server.tools.LDAPReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LDAPReader extends Object implements Closeable
This class defines a utility that can be used to read LDAP messages from a provided socket.
-
-
Constructor Summary
Constructors Constructor Description LDAPReader(Socket socket)Creates a new LDAP reader that will read messages from the provided socket and trace the messages using a provided tracer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this LDAP reader and the underlying socket.LDAPMessagereadMessage()Reads an LDAP message from the associated input stream.
-
-
-
Constructor Detail
-
LDAPReader
public LDAPReader(Socket socket) throws IOException
Creates a new LDAP reader that will read messages from the provided socket and trace the messages using a provided tracer.- Parameters:
socket- The socket from which to read the LDAP messages.- Throws:
IOException- If a problem occurs while attempting to obtain an input stream for the socket.
-
-
Method Detail
-
readMessage
public LDAPMessage readMessage() throws IOException, DecodeException, LDAPException
Reads an LDAP message from the associated input stream.- Returns:
- The LDAP message read from the associated input stream, or
nullif the end of the stream has been reached. - Throws:
IOException- If a problem occurs while attempting to read from the input stream.DecodeException- If a problem occurs while attempting to decode the data read as an ASN.1 sequence.LDAPException- If a problem occurs while attempting to decode the LDAP message.
-
close
public void close()
Closes this LDAP reader and the underlying socket.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-