Class 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 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:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable