Class AuditLogMessage
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.logs.AuditLogMessage
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AddAuditLogMessage,DeleteAuditLogMessage,ModifyAuditLogMessage,ModifyDNAuditLogMessage
@NotExtensible
@ThreadSafety(level=INTERFACE_THREADSAFE)
public abstract class AuditLogMessage
extends Object
implements 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:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAuditLogMessage(List<String> logMessageLines) Creates a new audit log message from the provided set of lines. -
Method Summary
Modifier and TypeMethodDescriptionprotected static ReadOnlyEntrydecodeCommentedEntry(String header, List<String> logMessageLines, String entryDN) Decodes an entry (or list of attributes) from the commented header contained in the log message lines.final StringRetrieves the alternate authorization DN for this audit log message, if available.abstract LDIFChangeRecordRetrieves an LDIF change record that encapsulates the change represented by this audit log message.abstract ChangeTypeRetrieves the change type for this audit log message.final StringRetrieves the line that comprises the header for this log message, including the leading octothorpe (#) and space that make it a comment.final LongRetrieves the connection ID for the connection on which the change was requested, if available.abstract StringgetDN()Retrieves the DN of the entry targeted by the associated operation.Retrieves a map of the name-value pairs contained in the header for this log message.final StringRetrieves the server instance name for this audit log message, if available.Retrieves an intermediate client request control with information about the downstream processing for the associated operation, if available.Retrieves the lines that comprise the complete audit log message.protected static BooleangetNamedValueAsBoolean(String name, Map<String, String> nameValuePairs) Retrieves the value of the header property with the given name as aBooleanobject.protected static LonggetNamedValueAsLong(String name, Map<String, String> nameValuePairs) Retrieves the value of the header property with the given name as aLongobject.final LongRetrieves the connection ID for the connection on which the change was requested, if available.Retrieves an operation purpose request control with information about the purpose for the associated operation, if available.final StringRetrieves the origin for this audit log message, if available.final StringRetrieves the server product name for this audit log message, if available.final StringRetrieves the replication change ID for this audit log message, if available.Retrieves a list of the OIDs of the request controls included in the operation request, if available.final StringRetrieves the DN of the user that requested the change, if available.final StringRetrieves the IP address of the client that requested the change, if available.abstract List<LDIFChangeRecord> Retrieves a list of the change records that can be used to revert the changes described by this audit log message.final StringRetrieves the unique identifier generated when the server was started, if available.final LongRetrieves the identifier for the server thread that processed the change, if available.final DateRetrieves the timestamp for this audit log message.final StringRetrieves the transaction ID for this audit log message, if available.final LongRetrieves the connection ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.final LongRetrieves the operation ID for the external operation that triggered the internal operation with which this audit log message is associated, if available.final StringRetrieves the line that comprises the header for this log message, without the leading octothorpe (#) and space that make it a comment.final BooleanRetrieves the value of the flag indicating whether the associated operation was processed using an administrative session worker thread, if available.abstract booleanIndicates whether it is possible to use thegetRevertChangeRecords()method to obtain a list of LDIF change records that can be used to revert the changes described by this audit log message.final StringRetrieves a multi-line string representation of this audit log message.final StringtoString()Retrieves a single-line string representation of this audit log message.abstract voidtoString(StringBuilder buffer) Appends a single-line string representation of this audit log message to the provided buffer.
-
Constructor Details
-
AuditLogMessage
Creates a new audit log message from the provided set of lines.- Parameters:
logMessageLines- The lines that comprise the log message. It must not benullor 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 aBooleanobject.- Parameters:
name- The name of the property to retrieve. It must not benull, and it will be treated in a case-sensitive manner.nameValuePairs- The map containing the header properties as name-value pairs. It must not benull.- Returns:
- The value of the specified property as a
Boolean, ornullif the property is not defined or if it cannot be parsed as aBoolean.
-
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 aLongobject.- Parameters:
name- The name of the property to retrieve. It must not benull, and it will be treated in a case-sensitive manner.nameValuePairs- The map containing the header properties as name-value pairs. It must not benull.- Returns:
- The value of the specified property as a
Long, ornullif the property is not defined or if it cannot be parsed as aLong.
-
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 benullif the commented entry includes a DN, and non-nullif the commented entry does not include a DN.- Returns:
- The entry that was decoded from the commented header, or
nullif 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
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
nullif 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
nullif it is not available.
-
getStartupID
Retrieves the unique identifier generated when the server was started, if available.- Returns:
- The unique identifier generated when the server was started, or
nullif it is not available.
-
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
nullif 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
nullif 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
nullif it is not available.
-
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
nullif it is not available.
-
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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif it is not available.
-
getOrigin
Retrieves the origin for this audit log message, if available.- Returns:
- The origin for this audit log message, or
nullif 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.TRUEif it is known that the associated operation was processed using an administrative session worker thread,Boolean.FALSEif it is known that the associated operation was not processed using an administrative session worker thread, ornullif 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
nullif 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
nullif 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
nullif it is not available.
-
getDN
Retrieves the DN of the entry targeted by the associated operation.- Returns:
- The DN of the entry targeted by the associated operation.
-
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
Indicates whether it is possible to use thegetRevertChangeRecords()method to obtain a list of LDIF change records that can be used to revert the changes described by this audit log message.- Returns:
trueif it is possible to use thegetRevertChangeRecords()method to obtain a list of LDIF change records that can be used to revert the changes described by this audit log message, orfalseif 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
Retrieves a single-line string representation of this audit log message. It will start with the string returned bygetUncommentedHeaderLine(), but will also contain additional name-value pairs that are pertinent to the type of operation that the audit log message represents. -
toString
Appends a single-line string representation of this audit log message to the provided buffer. The message will start with the string returned bygetUncommentedHeaderLine(), 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.
-