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
ConstructorsConstructorDescriptionDefaultAbstractMutationNotifyEventConverter(com.broadleafcommerce.common.extension.TypeFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionconvert(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source) protected AuditEventDetailgetDetail(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 aAdminAuditEventDetailinstance for the changed field on the changed entityprotected StringgetEventType(com.broadleafcommerce.data.tracking.core.Trackable changed) protected AuditEventHeadergetHeader(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed) Compile aAuditEventHeaderinstance for the changed entityintgetOrder()protected booleanisValid(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 booleanisValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed) Whether theTrackableinstance is valid for audit trackingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
convertin interfaceorg.springframework.core.convert.converter.Converter<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent,AuditEvent>
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
isValid
protected boolean isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed) Whether theTrackableinstance is valid for audit tracking- Parameters:
source- The source event detecting a changechanged- The modified entity- Returns:
- Whether the
Trackableinstance 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 changedetail- 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 aAuditEventHeaderinstance for the changed entity- Parameters:
source- The source event detecting a changechanged- The modified entity- Returns:
AuditEventHeaderinstance for the changed entity
-
getEventType
-
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 aAdminAuditEventDetailinstance for the changed field on the changed entity- Parameters:
source- The source event detecting a changechanged- The modified entitydetail- The descriptor for the field change- Returns:
AdminAuditEventDetailinstance for the changed field
-