org.opends.server.tools
Class LDAPWriter

java.lang.Object
  extended by org.opends.server.tools.LDAPWriter

public class LDAPWriter
extends java.lang.Object

This class defines a utility that can be used to write LDAP messages over a provided socket.


Constructor Summary
LDAPWriter(java.net.Socket socket)
          Creates a new LDAP writer that will write messages to the provided socket.
LDAPWriter(java.net.Socket socket, VerboseTracer tracer)
          Creates a new LDAP writer that will write messages to the provided socket and trace the messages using a provided tracer.
 
Method Summary
 void close()
          Closes this LDAP writer and the underlying socket.
 ASN1Writer getASN1Writer()
          Get the underlying ASN1 writer.
 void writeMessage(LDAPMessage message)
          Writes an LDAP message to the associated output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPWriter

public LDAPWriter(java.net.Socket socket)
           throws java.io.IOException
Creates a new LDAP writer that will write messages to the provided socket.

Parameters:
socket - The socket to use to write LDAP messages.
Throws:
java.io.IOException - If a problem occurs while attempting to obtain an ASN.1 reader for the socket.

LDAPWriter

public LDAPWriter(java.net.Socket socket,
                  VerboseTracer tracer)
           throws java.io.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.
tracer - Specifies a tracer to be used for tracing messages written.
Throws:
java.io.IOException - If a problem occurs while attempting to obtain an output stream for the socket.
Method Detail

writeMessage

public void writeMessage(LDAPMessage message)
                  throws java.io.IOException
Writes an LDAP message to the associated output stream.

Parameters:
message - The message to be written.
Throws:
java.io.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.


getASN1Writer

public ASN1Writer getASN1Writer()
Get the underlying ASN1 writer.

Returns:
The underlying ASN1 writer.