Package netscape.ldap

Class LDAPMessage

java.lang.Object
netscape.ldap.LDAPMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LDAPResponse, LDAPSearchResult, LDAPSearchResultReference

public class LDAPMessage extends Object implements Serializable
Base class for LDAP request and response messages. This class represents the LDAPMessage in RFC2251. The message is the entity that got transferred back and fro between the server and the client interface. Each message has a protocol operation. The protocol operation indicates if it is a request or response.
 LDAPMessage ::= SEQUENCE {
   messageID MessageID,
   protocolOp CHOICE {
     bindRequest BindRequest,
     ...
   }
   controls [0] Controls OPTIONAL
 }
 
Version:
1.0
See Also:
  • Field Details

  • Constructor Details

    • LDAPMessage

      LDAPMessage(int msgid, JDAPProtocolOp op)
      Constructs a ldap message.
      Parameters:
      msgid - message identifier
      op - operation protocol
    • LDAPMessage

      LDAPMessage(int msgid, JDAPProtocolOp op, LDAPControl[] controls)
  • Method Details

    • parseMessage

      static LDAPMessage parseMessage(BERElement element) throws IOException
      Creates a ldap message from a BERElement. This method is used to parse LDAP response messages
      Parameters:
      element - ber element constructed from incoming byte stream
      Throws:
      IOException
    • getMessageID

      public int getMessageID()
      Returns the message identifer.
      Returns:
      message identifer.
    • getType

      public int getType()
      Returns the LDAP operation type of the message
      Returns:
      message type.
    • getProtocolOp

      JDAPProtocolOp getProtocolOp()
      Retrieves the protocol operation.
      Returns:
      protocol operation.
    • getControls

      public LDAPControl[] getControls()
      Retrieves list of controls.
      Returns:
      controls.
    • write

      void write(OutputStream s) throws IOException
      Writes the ber encoding to stream.
      Parameters:
      s - output stream
      Throws:
      IOException
    • toString

      public String toString()
      Returns string representation of an LDAP message.
      Overrides:
      toString in class Object
      Returns:
      LDAP message.
    • toTraceString

      StringBuffer toTraceString()
      Returns string representation of a ldap message with the time stamp. Used for message trace
      Returns:
      ldap message with the time stamp