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 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 aAdminAuditEventDetail
instance for the changed field on the changed entityprotected String
getEventType
(com.broadleafcommerce.data.tracking.core.Trackable changed) protected AuditEventHeader
getHeader
(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed) Compile aAuditEventHeader
instance for the changed entityint
getOrder()
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 theTrackable
instance is valid for audit trackingMethods 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 interfaceorg.springframework.core.convert.converter.Converter<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent,
AuditEvent>
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
isValid
protected boolean isValid(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent source, com.broadleafcommerce.data.tracking.core.Trackable changed) Whether theTrackable
instance is valid for audit tracking- Parameters:
source
- The source event detecting a changechanged
- 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 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 aAuditEventHeader
instance for the changed entity- Parameters:
source
- The source event detecting a changechanged
- The modified entity- Returns:
AuditEventHeader
instance 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 aAdminAuditEventDetail
instance 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:
AdminAuditEventDetail
instance for the changed field
-