Class AuditEventHeader

java.lang.Object
com.broadleafcommerce.common.audit.domain.AuditEventHeader
All Implemented Interfaces:
Serializable

public class AuditEventHeader extends Object implements Serializable
Header information for an audit record. Also supports the builder pattern by using AuditEventHeader.builder().
See Also:
  • Constructor Details

    • AuditEventHeader

      public AuditEventHeader(@NonNull @NonNull Instant timestamp, @Nullable String entityType, @Nullable String entityRef, @Nullable String customerid, @Nullable String accountid, @NonNull @NonNull String tenantId, @Nullable String catalogId, @Nullable String applicationId, @NonNull @NonNull String detailType, @Nullable Map<String,String> additionalAttributes, @Nullable Duration retentionPeriod, @NonNull @NonNull String eventType, @Nullable String containerEventType, @Nullable String containerRef, @Nullable String primaryAuthor, @Nullable String secondaryAuthor)
  • Method Details

    • builder

    • getTimestamp

      public Instant getTimestamp()
      The time at which the change was reported to the system. Required.
    • getEntityType

      @Nullable public String getEntityType()
      Fully qualified class name of the top-level entity being changed. Optional. For audit changes to a particular entity.
    • getEntityRef

      @Nullable public String getEntityRef()
      Identifying reference to the entity. Usually a contextId for Trackable domain. Optional. For audit changes to a particular entity.
    • getCustomerid

      @Nullable public String getCustomerid()
      Identifier for a customer entity. Useful for identifying a customer related to the change. Optional. For audit events related to a customer.
    • getAccountid

      @Nullable public String getAccountid()
      Identifier for an account entity. Useful for identifying an account related to the change. Optional. For audit events related to an account.
    • getTenantId

      public String getTenantId()
      The tenant to whom this audit record belongs. Required.
    • getCatalogId

      @Nullable public String getCatalogId()
      The catalog to which this audit record belongs. Optional. For audit events related to a catalog discriminated entity.
    • getApplicationId

      @Nullable public String getApplicationId()
      The application to which this audit record belongs. Optional. For audit events related to an application discriminated entity.
    • getDetailType

      public String getDetailType()
      The type of detail information associated with this audit event. See DetailType.
    • getAdditionalAttributes

      @Nullable public Map<String,String> getAdditionalAttributes()
      Any additional information, possibly required in extension scenarios. Optional.
    • getRetentionPeriod

      @Nullable public Duration getRetentionPeriod()
      Optional. The amount of time to keep this record in hot storage (i.e. searchable in AuditServices). If set, will override the default retention period defined in AuditServices. See com.broadleafcommerce.audit.env.AuditPruneProperties#retentionPeriod in AuditServices for the system default.
    • getEventType

      public String getEventType()
      In the case of Trackable entity change, The name of the top-level entity that changed, which is typically snake-cased and capitalized, i.e., "PRODUCT". Arbitrary audit events may use this field to represent the type of event. Required.
    • getContainerEventType

      @Nullable public String getContainerEventType()
      In the case of Trackable entity change, The name of the containing entity, which is typically snake-cased and capitalized, i.e., "PRODUCT". This is a grouping concept for correlating multiple related changes to a singular concept. For example, a marketing message change, which from the admin perspective looks like a change to an offer. Optional.
    • getContainerRef

      @Nullable public String getContainerRef()
      Identifying reference to the containing entity. Usually a contextId for Trackable domain. Optional. See containerEventType.
    • getPrimaryAuthor

      @Nullable public String getPrimaryAuthor()
      The primary author of the change. Optional. For DetailType.CHANGE_DETAIL events, this field generally represents the approver of the overall entity change. See AuditEventDetail.getAuthor() for more specific ownership of field-level changes. For non-CHANGE_DETAIL events, this field represents the user driving the event.
    • getSecondaryAuthor

      @Nullable public String getSecondaryAuthor()
      Any additional author for the change. Optional. For DetailType.CHANGE_DETAIL events, this field generally represents the user engaged the deployment. For non-CHANGE_DETAIL events, this field represents any CSR impersonating the primary author for the event.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object