Class AuditRecordUtils

java.lang.Object
org.alfresco.repo.audit.AuditRecordUtils

public final class AuditRecordUtils extends Object
  • Method Details

    • generateAuditRecordBuilder

      public static AuditRecord.Builder generateAuditRecordBuilder(Map<String,Serializable> data, int keyRootLength)
      Generates an AuditRecord.Builder from flat audit data.

      This method:

      • Translates flat key-value pairs into a nested JSON structure.
      • Preloads the builder with the provided arguments.
      • Splits keys by / to build the nested structure.
      • Uses the root key as the application ID.
      • Assumes each key starts with the same root, constructed as '/' + auditedApplicationName + '/', which is removed before splitting.
      Parameters:
      data - a map containing flat audit data as `key-value` pairs
      keyRootLength - is a length of key root.
      Returns:
      a preloaded AuditRecord.Builder