Class LdapWriter


  • public final class LdapWriter
    extends Object
    Writes LDAP messages to an underlying ASN.1 writer.

    Methods for creating LdapWriters are provided in the Ldap class.

    • Method Detail

      • getProtocolVersion

        public int getProtocolVersion()
        Returns the protocol version supported by this LdapWriter.
        Returns:
        The protocol version supported by this LdapWriter
      • writeLdapMessage

        public void writeLdapMessage​(LdapMessage ldapMessage)
                              throws IOException
        Writes the provided LDAP message.
        Parameters:
        ldapMessage - The message to write.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeAbandonRequest

        public void writeAbandonRequest​(int messageID,
                                        AbandonRequest request)
                                 throws IOException
        Writes the provided abandon request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeAddRequest

        public void writeAddRequest​(int messageID,
                                    AddRequest request)
                             throws IOException
        Writes the provided add request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeAddResult

        public void writeAddResult​(int messageID,
                                   Result result)
                            throws IOException
        Writes the provided add result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeBindRequest

        public void writeBindRequest​(int messageID,
                                     BindRequest request)
                              throws IOException
        Writes the provided bind request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeBindResult

        public void writeBindResult​(int messageID,
                                    Result result)
                             throws IOException
        Writes the provided bind result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeCompareRequest

        public void writeCompareRequest​(int messageID,
                                        CompareRequest request)
                                 throws IOException
        Writes the provided compare request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeCompareResult

        public void writeCompareResult​(int messageID,
                                       Result result)
                                throws IOException
        Writes the provided compare result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeControl

        public void writeControl​(Control control)
                          throws IOException
        Writes the provided control.
        Parameters:
        control - The control.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeDeleteRequest

        public void writeDeleteRequest​(int messageID,
                                       DeleteRequest request)
                                throws IOException
        Writes the provided delete request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeDeleteResult

        public void writeDeleteResult​(int messageID,
                                      Result result)
                               throws IOException
        Writes the provided delete result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeExtendedRequest

        public void writeExtendedRequest​(int messageID,
                                         ExtendedRequest<?> request)
                                  throws IOException
        Writes the provided extended request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeExtendedResult

        public void writeExtendedResult​(int messageID,
                                        Result result)
                                 throws IOException
        Writes the provided extended result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeIntermediateResponse

        public void writeIntermediateResponse​(int messageID,
                                              IntermediateResponse response)
                                       throws IOException
        Writes the provided intermediate response.
        Parameters:
        messageID - The LDAP message ID.
        response - The response.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeModifyDnRequest

        public void writeModifyDnRequest​(int messageID,
                                         ModifyDnRequest request)
                                  throws IOException
        Writes the provided modify DN request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeModifyDnResult

        public void writeModifyDnResult​(int messageID,
                                        Result result)
                                 throws IOException
        Writes the provided modify DN result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeModifyRequest

        public void writeModifyRequest​(int messageID,
                                       ModifyRequest request)
                                throws IOException
        Writes the provided modify request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeModifyResult

        public void writeModifyResult​(int messageID,
                                      Result result)
                               throws IOException
        Writes the provided extended result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeSearchRequest

        public void writeSearchRequest​(int messageID,
                                       SearchRequest request)
                                throws IOException
        Writes the provided search request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeSearchResult

        public void writeSearchResult​(int messageID,
                                      Result result)
                               throws IOException
        Writes the provided search result.
        Parameters:
        messageID - The LDAP message ID.
        result - The result.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeSearchResultEntry

        public void writeSearchResultEntry​(int messageID,
                                           SearchResultEntry entry)
                                    throws IOException
        Writes the provided search result entry.
        Parameters:
        messageID - The LDAP message ID.
        entry - The entry.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeSearchResultReference

        public void writeSearchResultReference​(int messageID,
                                               SearchResultReference reference)
                                        throws IOException
        Writes the provided search result reference.
        Parameters:
        messageID - The LDAP message ID.
        reference - The reference.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeUnbindRequest

        public void writeUnbindRequest​(int messageID,
                                       UnbindRequest request)
                                throws IOException
        Writes the provided unbind request.
        Parameters:
        messageID - The LDAP message ID.
        request - The request.
        Throws:
        IOException - If an unexpected IO error occurred.
      • writeUnknownRequest

        public void writeUnknownRequest​(int messageID,
                                        UnknownRequest unknownRequest)
                                 throws IOException
        Writes the provided unknown request.
        Parameters:
        messageID - The LDAP message ID.
        unknownRequest - The request.
        Throws:
        IOException - If an unexpected IO error occurred.