Class DefaultAbstractMutationNotifyEventConverter

java.lang.Object
com.broadleafcommerce.common.audit.converter.DefaultAbstractMutationNotifyEventConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent,AuditEvent>, org.springframework.core.Ordered
Direct Known Subclasses:
DefaultMutationNotifyEventConverter

public abstract class DefaultAbstractMutationNotifyEventConverter extends Object implements org.springframework.core.convert.converter.Converter<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent,AuditEvent>, org.springframework.core.Ordered
Basic converter that contains much of the plumbing required for conversion. Subclasses may override protected methods to enhance the behavior for specific domain use cases. This includes validating specific types and filtering included fields.
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultAbstractMutationNotifyEventConverter(com.broadleafcommerce.common.extension.TypeFactory factory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source)
     
    getDetail(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed, com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeDetail detail)
    Compile a AdminAuditEventDetail instance for the changed field on the changed entity
    protected String
    getEventType(com.broadleafcommerce.data.tracking.core.Trackable changed)
     
    getHeader(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed)
    Compile a AuditEventHeader instance for the changed entity
    int
     
    protected boolean
    isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeDetail detail)
    Whether the specific field change (i.e.
    protected boolean
    isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed)
    Whether the Trackable instance is valid for audit tracking

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.core.convert.converter.Converter

    andThen
  • Constructor Details

    • DefaultAbstractMutationNotifyEventConverter

      public DefaultAbstractMutationNotifyEventConverter(com.broadleafcommerce.common.extension.TypeFactory factory)
  • Method Details

    • convert

      @Nullable public AuditEvent convert(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent,AuditEvent>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • isValid

      protected boolean isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed)
      Whether the Trackable instance is valid for audit tracking
      Parameters:
      source - The source event detecting a change
      changed - The modified entity
      Returns:
      Whether the Trackable instance is valid for audit tracking
    • isValid

      protected boolean isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeDetail detail)
      Whether the specific field change (i.e. ChangeDetail) is valid for audit tracking
      Parameters:
      source - The source event detecting a change
      detail - The descriptor for the field change
      Returns:
      Whether the specific field change (i.e. ChangeDetail) is valid for audit tracking
    • getHeader

      protected AuditEventHeader getHeader(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed)
      Compile a AuditEventHeader instance for the changed entity
      Parameters:
      source - The source event detecting a change
      changed - The modified entity
      Returns:
      AuditEventHeader instance for the changed entity
    • getEventType

      protected String getEventType(com.broadleafcommerce.data.tracking.core.Trackable changed)
    • getDetail

      protected AuditEventDetail getDetail(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed, com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeDetail detail)
      Compile a AdminAuditEventDetail instance for the changed field on the changed entity
      Parameters:
      source - The source event detecting a change
      changed - The modified entity
      detail - The descriptor for the field change
      Returns:
      AdminAuditEventDetail instance for the changed field