Package org.opends.server.tools
Class LDAPWriter
- java.lang.Object
-
- org.opends.server.tools.LDAPWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LDAPWriter extends Object implements Closeable
This class defines a utility that can be used to write LDAP messages over a provided socket.
-
-
Constructor Summary
Constructors Constructor Description LDAPWriter(Socket socket)Creates a new LDAP writer that will write messages to 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 writer and the underlying socket.voidwriteMessage(LDAPMessage message)Writes an LDAP message to the associated output stream.
-
-
-
Constructor Detail
-
LDAPWriter
public LDAPWriter(Socket socket) throws IOException
Creates a new LDAP writer that will write messages to the provided socket and trace the messages using a provided tracer.- Parameters:
socket- The socket to use to write LDAP messages.- Throws:
IOException- If a problem occurs while attempting to obtain an output stream for the socket.
-
-
Method Detail
-
writeMessage
public void writeMessage(LDAPMessage message) throws IOException
Writes an LDAP message to the associated output stream.- Parameters:
message- The message to be written.- Throws:
IOException- If a problem occurs while trying to write the information over the output stream.
-
close
public void close()
Closes this LDAP writer and the underlying socket.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-