Class AuditLogMessage

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AddAuditLogMessage, DeleteAuditLogMessage, ModifyAuditLogMessage, ModifyDNAuditLogMessage

    @NotExtensible
    @ThreadSafety(level=INTERFACE_THREADSAFE)
    public abstract class AuditLogMessage
    extends java.lang.Object
    implements java.io.Serializable
    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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AuditLogMessage​(java.util.List<java.lang.String> logMessageLines)
      Creates a new audit log message from the provided set of lines.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected static ReadOnlyEntry decodeCommentedEntry​(java.lang.String header, java.util.List<java.lang.String> logMessageLines, java.lang.String entryDN)
      Decodes an entry (or list of attributes) from the commented header contained in the log message lines.
      java.lang.String getAlternateAuthorizationDN()
      Retrieves the alternate authorization DN for this audit log message, if available.
      abstract LDIFChangeRecord getChangeRecord()
      Retrieves an LDIF change record that encapsulates the change represented by this audit log message.
      abstract ChangeType getChangeType()
      Retrieves the change type for this audit log message.
      java.lang.String getCommentedHeaderLine()
      Retrieves the line that comprises the header for this log message, including the leading octothorpe (#) and space that make it a comment.
      java.lang.Long getConnectionID()
      Retrieves the connection ID for the connection on which the change was requested, if available.
      abstract java.lang.String getDN()
      Retrieves the DN of the entry targeted by the associated operation.
      java.util.Map<java.lang.String,​java.lang.String> getHeaderNamedValues()
      Retrieves a map of the name-value pairs contained in the header for this log message.
      java.lang.String getInstanceName()
      Retrieves the server instance name for this audit log message, if available.
      IntermediateClientRequestControl getIntermediateClientRequestControl()
      Retrieves an intermediate client request control with information about the downstream processing for the associated operation, if available.
      java.util.List<java.lang.String> getLogMessageLines()
      Retrieves the lines that comprise the complete audit log message.
      protected static java.lang.Boolean getNamedValueAsBoolean​(java.lang.String name, java.util.Map<java.lang.String,​java.lang.String> nameValuePairs)
      Retrieves the value of the header property with the given name as a Boolean object.
      protected static java.lang.Long getNamedValueAsLong​(java.lang.String name, java.util.Map<java.lang.String,​java.lang.String> nameValuePairs)
      Retrieves the value of the header property with the given name as a Long object.
      java.lang.Long getOperationID()
      Retrieves the connection ID for the connection on which the change was requested, if available.
      OperationPurposeRequestControl getOperationPurposeRequestControl()
      Retrieves an operation purpose request control with information about the purpose for the associated operation, if available.
      java.lang.String getOrigin()
      Retrieves the origin for this audit log message, if available.
      java.lang.String getProductName()
      Retrieves the server product name for this audit log message, if available.
      java.lang.String getReplicationChangeID()
      Retrieves the replication change ID for this audit log message, if available.
      java.util.List<java.lang.String> getRequestControlOIDs()
      Retrieves a list of the OIDs of the request controls included in the operation request, if available.
      java.lang.String getRequesterDN()
      Retrieves the DN of the user that requested the change, if available.
      java.lang.String getRequesterIPAddress()
      Retrieves the IP address of the client that requested the change, if available.
      abstract java.util.List<LDIFChangeRecord> getRevertChangeRecords()
      Retrieves a list of the change records that can be used to revert the changes described by this audit log message.
      java.lang.String getStartupID()
      Retrieves the unique identifier generated when the server was started, if available.
      java.lang.Long getThreadID()
      Retrieves the identifier for the server thread that processed the change, if available.
      java.util.Date getTimestamp()
      Retrieves the timestamp for this audit log message.
      java.lang.String getTransactionID()
      Retrieves the transaction ID for this audit log message, if available.
      java.lang.Long getTriggeredByConnectionID()
      Retrieves the connection ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.
      java.lang.Long getTriggeredByOperationID()
      Retrieves the operation ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.
      java.lang.String getUncommentedHeaderLine()
      Retrieves the line that comprises the header for this log message, without the leading octothorpe (#) and space that make it a comment.
      java.lang.Boolean getUsingAdminSessionWorkerThread()
      Retrieves the value of the flag indicating whether the associated operation was processed using an administrative session worker thread, if available.
      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.
      java.lang.String toMultiLineString()
      Retrieves a multi-line string representation of this audit log message.
      java.lang.String toString()
      Retrieves a single-line string representation of this audit log message.
      abstract void toString​(java.lang.StringBuilder buffer)
      Appends a single-line string representation of this audit log message to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AuditLogMessage

        protected AuditLogMessage​(java.util.List<java.lang.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 Detail

      • getNamedValueAsBoolean

        protected static java.lang.Boolean getNamedValueAsBoolean​(java.lang.String name,
                                                                  java.util.Map<java.lang.String,​java.lang.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

        protected static java.lang.Long getNamedValueAsLong​(java.lang.String name,
                                                            java.util.Map<java.lang.String,​java.lang.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

        protected static ReadOnlyEntry decodeCommentedEntry​(java.lang.String header,
                                                            java.util.List<java.lang.String> logMessageLines,
                                                            java.lang.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

        public final java.util.List<java.lang.String> getLogMessageLines()
        Retrieves the lines that comprise the complete audit log message.
        Returns:
        The lines that comprise the complete audit log message.
      • getCommentedHeaderLine

        public final java.lang.String 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

        public final java.lang.String 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

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

        public final java.util.Map<java.lang.String,​java.lang.String> 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

        public final java.lang.String 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

        public final java.lang.String 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

        public final java.lang.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

        public final java.lang.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

        public final java.lang.String 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

        public final java.lang.String 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

        public final java.lang.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

        public final java.lang.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

        public final java.lang.Long 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

        public final java.lang.Long 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

        public final java.lang.String 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

        public final java.lang.String 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

        public final java.lang.String 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

        public final java.lang.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

        public final java.lang.Boolean 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

        public final java.util.List<java.lang.String> 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

        public final OperationPurposeRequestControl 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

        public final IntermediateClientRequestControl 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

        public abstract java.lang.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

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

        public abstract LDIFChangeRecord 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

        public abstract java.util.List<LDIFChangeRecordgetRevertChangeRecords()
                                                                         throws AuditLogException
        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

        public final java.lang.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 java.lang.Object
        Returns:
        A string representation of this audit log message.
      • toString

        public abstract void toString​(java.lang.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

        public final java.lang.String 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.