Class AuditLogMessage

java.lang.Object
com.unboundid.ldap.sdk.unboundidds.logs.AuditLogMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AddAuditLogMessage, DeleteAuditLogMessage, ModifyAuditLogMessage, ModifyDNAuditLogMessage

This class provides a data structure that holds information about a log message that may appear in the Directory Server audit log.
NOTE: This class, and other classes within the com.unboundid.ldap.sdk.unboundidds package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
See Also:
  • Constructor Details

    • AuditLogMessage

      protected AuditLogMessage(@NotNull List<String> logMessageLines) throws AuditLogException
      Creates a new audit log message from the provided set of lines.
      Parameters:
      logMessageLines - The lines that comprise the log message. It must not be null or empty, and it must not contain any blank lines, although it may contain comments. In fact, it must contain at least one comment line that appears before any non-comment lines (but possibly after other comment lines) that serves as the message header.
      Throws:
      AuditLogException - If a problem is encountered while processing the provided list of log message lines.
  • Method Details

    • getNamedValueAsBoolean

      @Nullable protected static Boolean getNamedValueAsBoolean(@NotNull String name, @NotNull Map<String,String> nameValuePairs)
      Retrieves the value of the header property with the given name as a Boolean object.
      Parameters:
      name - The name of the property to retrieve. It must not be null, and it will be treated in a case-sensitive manner.
      nameValuePairs - The map containing the header properties as name-value pairs. It must not be null.
      Returns:
      The value of the specified property as a Boolean, or null if the property is not defined or if it cannot be parsed as a Boolean.
    • getNamedValueAsLong

      @Nullable protected static Long getNamedValueAsLong(@NotNull String name, @NotNull Map<String,String> nameValuePairs)
      Retrieves the value of the header property with the given name as a Long object.
      Parameters:
      name - The name of the property to retrieve. It must not be null, and it will be treated in a case-sensitive manner.
      nameValuePairs - The map containing the header properties as name-value pairs. It must not be null.
      Returns:
      The value of the specified property as a Long, or null if the property is not defined or if it cannot be parsed as a Long.
    • decodeCommentedEntry

      @Nullable protected static ReadOnlyEntry decodeCommentedEntry(@NotNull String header, @NotNull List<String> logMessageLines, @Nullable String entryDN)
      Decodes an entry (or list of attributes) from the commented header contained in the log message lines.
      Parameters:
      header - The header line that appears before the encoded entry.
      logMessageLines - The lines that comprise the audit log message.
      entryDN - The DN to use for the entry that is read. It should be null if the commented entry includes a DN, and non-null if the commented entry does not include a DN.
      Returns:
      The entry that was decoded from the commented header, or null if it is not included in the header or if it cannot be decoded. If the commented entry does not include a DN, then the DN of the entry returned will be the null DN.
    • getLogMessageLines

      Retrieves the lines that comprise the complete audit log message.
      Returns:
      The lines that comprise the complete audit log message.
    • getCommentedHeaderLine

      Retrieves the line that comprises the header for this log message, including the leading octothorpe (#) and space that make it a comment.
      Returns:
      The line that comprises the header for this log message, including the leading octothorpe (#) and space that make it a comment.
    • getUncommentedHeaderLine

      Retrieves the line that comprises the header for this log message, without the leading octothorpe (#) and space that make it a comment.
      Returns:
      The line that comprises the header for this log message, without the leading octothorpe (#) and space that make it a comment.
    • getTimestamp

      @NotNull public final Date getTimestamp()
      Retrieves the timestamp for this audit log message.
      Returns:
      The timestamp for this audit log message.
    • getHeaderNamedValues

      Retrieves a map of the name-value pairs contained in the header for this log message.
      Returns:
      A map of the name-value pairs contained in the header for this log message.
    • getProductName

      Retrieves the server product name for this audit log message, if available.
      Returns:
      The server product name for this audit log message, or null if it is not available.
    • getInstanceName

      Retrieves the server instance name for this audit log message, if available.
      Returns:
      The server instance name for this audit log message, or null if it is not available.
    • getStartupID

      @Nullable public final String getStartupID()
      Retrieves the unique identifier generated when the server was started, if available.
      Returns:
      The unique identifier generated when the server was started, or null if it is not available.
    • getThreadID

      @Nullable public final Long getThreadID()
      Retrieves the identifier for the server thread that processed the change, if available.
      Returns:
      The identifier for the server thread that processed the change, or null if it is not available.
    • getRequesterDN

      Retrieves the DN of the user that requested the change, if available.
      Returns:
      The DN of the user that requested the change, or null if it is not available.
    • getRequesterIPAddress

      Retrieves the IP address of the client that requested the change, if available.
      Returns:
      The IP address of the client that requested the change, or null if it is not available.
    • getConnectionID

      @Nullable public final Long getConnectionID()
      Retrieves the connection ID for the connection on which the change was requested, if available.
      Returns:
      The connection ID for the connection on which the change was requested, or null if it is not available.
    • getOperationID

      @Nullable public final Long getOperationID()
      Retrieves the connection ID for the connection on which the change was requested, if available.
      Returns:
      The connection ID for the connection on which the change was requested, or null if it is not available.
    • getTriggeredByConnectionID

      Retrieves the connection ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.
      Returns:
      The connection ID for the external operation that triggered the internal operation with which this audit log message is associated, or null if it is not available.
    • getTriggeredByOperationID

      Retrieves the operation ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.
      Returns:
      The operation ID for the external operation that triggered the internal operation with which this audit log message is associated, or null if it is not available.
    • getReplicationChangeID

      Retrieves the replication change ID for this audit log message, if available.
      Returns:
      The replication change ID for this audit log message, or null if it is not available.
    • getAlternateAuthorizationDN

      Retrieves the alternate authorization DN for this audit log message, if available.
      Returns:
      The alternate authorization DN for this audit log message, or null if it is not available.
    • getTransactionID

      Retrieves the transaction ID for this audit log message, if available.
      Returns:
      The transaction ID for this audit log message, or null if it is not available.
    • getOrigin

      @Nullable public final String getOrigin()
      Retrieves the origin for this audit log message, if available.
      Returns:
      The origin for this audit log message, or null if it is not available.
    • getUsingAdminSessionWorkerThread

      Retrieves the value of the flag indicating whether the associated operation was processed using an administrative session worker thread, if available.
      Returns:
      Boolean.TRUE if it is known that the associated operation was processed using an administrative session worker thread, Boolean.FALSE if it is known that the associated operation was not processed using an administrative session worker thread, or null if it is not available.
    • getRequestControlOIDs

      Retrieves a list of the OIDs of the request controls included in the operation request, if available.
      Returns:
      A list of the OIDs of the request controls included in the operation, an empty list if it is known that there were no request controls, or null if it is not available.
    • getOperationPurposeRequestControl

      Retrieves an operation purpose request control with information about the purpose for the associated operation, if available.
      Returns:
      An operation purpose request control with information about the purpose for the associated operation, or null if it is not available.
    • getIntermediateClientRequestControl

      Retrieves an intermediate client request control with information about the downstream processing for the associated operation, if available.
      Returns:
      An intermediate client request control with information about the downstream processing for the associated operation, or null if it is not available.
    • getDN

      @NotNull public abstract String getDN()
      Retrieves the DN of the entry targeted by the associated operation.
      Returns:
      The DN of the entry targeted by the associated operation.
    • getChangeType

      @NotNull public abstract ChangeType getChangeType()
      Retrieves the change type for this audit log message.
      Returns:
      The change type for this audit log message.
    • getChangeRecord

      Retrieves an LDIF change record that encapsulates the change represented by this audit log message.
      Returns:
      An LDIF change record that encapsulates the change represented by this audit log message.
    • isRevertible

      public abstract boolean isRevertible()
      Indicates whether it is possible to use the getRevertChangeRecords() method to obtain a list of LDIF change records that can be used to revert the changes described by this audit log message.
      Returns:
      true if it is possible to use the getRevertChangeRecords() method to obtain a list of LDIF change records that can be used to revert the changes described by this audit log message, or false if not.
    • getRevertChangeRecords

      Retrieves a list of the change records that can be used to revert the changes described by this audit log message.
      Returns:
      A list of the change records that can be used to revert the changes described by this audit log message.
      Throws:
      AuditLogException - If this audit log message cannot be reverted.
    • toString

      @NotNull public final String toString()
      Retrieves a single-line string representation of this audit log message. It will start with the string returned by getUncommentedHeaderLine(), but will also contain additional name-value pairs that are pertinent to the type of operation that the audit log message represents.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this audit log message.
    • toString

      public abstract void toString(@NotNull StringBuilder buffer)
      Appends a single-line string representation of this audit log message to the provided buffer. The message will start with the string returned by getUncommentedHeaderLine(), but will also contain additional name-value pairs that are pertinent to the type of operation that the audit log message represents.
      Parameters:
      buffer - The buffer to which the information should be appended.
    • toMultiLineString

      Retrieves a multi-line string representation of this audit log message. It will simply be a concatenation of all of the lines that comprise the complete log message, with line breaks between them.
      Returns:
      A multi-line string representation of this audit log message.