Class NotificationAwareDomainMapperMember
java.lang.Object
com.broadleafcommerce.sandbox.messaging.mapping.NotificationAwareDomainMapperMember
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
,com.broadleafcommerce.data.tracking.core.mapping.DomainMapper
,com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
,org.springframework.core.Ordered
- Direct Known Subclasses:
JpaNotificationAwareDomainMapperMember
public class NotificationAwareDomainMapperMember
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
Map new
NotificationStateAware
instances with ready-to-use NotificationState
values for the TransitionRequest class of producers.- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
ALL_MATCH
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationAwareDomainMapperMember
(com.broadleafcommerce.common.extension.TypeFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addStateContainerIfApplicable
(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String messageType) Adds a state container to the notification states list if not already present for the givenmessageType
.<D> D
deleteMap
(D repositoryDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) <D> D
fromBusinessDomain
(Object businessDomain, D repositoryDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.common.extension.TypeFactory
protected void
initializeContainerValues
(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String containerName) <D,
P> D modifyMap
(D repositoryDomain, P businessDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean allowNull) protected <D> D
setupAllNotificationContainerStates
(Object businessDomain, D repositoryDomain) protected void
setupDeployNotificationContainerStates
(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String changeStatus) protected void
setupGeneralNotificationContainerStates
(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity) protected void
setupSummaryNotificationContainerStates
(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, ChangeSummary businessDomain) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapper
getBusinessDomainType
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
fromRepositoryDomain, getOrder
-
Constructor Details
-
NotificationAwareDomainMapperMember
public NotificationAwareDomainMapperMember(com.broadleafcommerce.common.extension.TypeFactory factory)
-
-
Method Details
-
getDataRoutePartition
- Specified by:
getDataRoutePartition
in interfacecom.broadleafcommerce.common.extension.data.DataRoutePartitionAware
-
fromBusinessDomain
public <D> D fromBusinessDomain(Object businessDomain, D repositoryDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
fromBusinessDomain
in interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
-
modifyMap
public <D,P> D modifyMap(D repositoryDomain, P businessDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean allowNull) - Specified by:
modifyMap
in interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapper
-
setupAllNotificationContainerStates
-
setupSummaryNotificationContainerStates
protected void setupSummaryNotificationContainerStates(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, ChangeSummary businessDomain) - Parameters:
entity
- the persisted domain instance ofChangeSummary
on which notification states need to be set upbusinessDomain
- an instance ofChangeSummary
-
setupGeneralNotificationContainerStates
protected void setupGeneralNotificationContainerStates(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity) -
setupDeployNotificationContainerStates
protected void setupDeployNotificationContainerStates(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String changeStatus) - Parameters:
entity
- the persisted domain instance ofChangeDeploy
on which notification states need to be set upchangeStatus
- theChangeDeploy.getStatus()
found in the business instance
-
initializeContainerValues
protected void initializeContainerValues(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String containerName) -
addStateContainerIfApplicable
protected boolean addStateContainerIfApplicable(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity, String messageType) Adds a state container to the notification states list if not already present for the givenmessageType
.- Parameters:
entity
- the entity whose notification states should be updatedmessageType
- the message type for which a notification state should be created- Returns:
- true if a container was created/added, false if one was already present
-
deleteMap
public <D> D deleteMap(D repositoryDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
deleteMap
in interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapper
-
getFactory
public com.broadleafcommerce.common.extension.TypeFactory getFactory()
-