Class SingleIndexRequestNotificationStateMapperMember

java.lang.Object
com.broadleafcommerce.data.tracking.core.messaging.search.mapping.SingleIndexRequestNotificationStateMapperMember
All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware, DomainMapper, DomainMapperMember, org.springframework.core.Ordered

public class SingleIndexRequestNotificationStateMapperMember extends Object implements DomainMapperMember
A DomainMapperMember that is responsible for initializing the NotificationState for SingleIndexRequestProducer on Indexable entities.
Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • SingleIndexRequestNotificationStateMapperMember

      public SingleIndexRequestNotificationStateMapperMember(com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, TrackableBehaviorUtil util)
  • Method Details

    • setSingleIndexRequestMessageFactory

      @Autowired(required=false) public void setSingleIndexRequestMessageFactory(@Nullable com.broadleafcommerce.common.messaging.notification.MessageFactory<SingleIndexRequest<Identifiable>> singleIndexRequestMessageFactory)
    • getDataRoutePartition

      public String getDataRoutePartition()
      Specified by:
      getDataRoutePartition in interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
    • getOrder

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

      @Nullable public <D> D fromBusinessDomain(Object businessDomain, D repositoryDomain, @Nullable ContextInfo contextInfo)
      Description copied from interface: DomainMapperMember
      Map and return a populated repository domain instance, based on information provided in a business domain. The passed repositoryDomain parameter is generally transformed and returned.
      Specified by:
      fromBusinessDomain in interface DomainMapperMember
      Type Parameters:
      D - The repository domain type
      Parameters:
      businessDomain - The business instance containing the relevant property information
      repositoryDomain - The repository specific instance to affect and return
      contextInfo - The context information used to make tracking determinations relevant to sandboxing and multitenant concerns. See TrackableRepository for more info on persistence behavior based on context.
      Returns:
      The populated repository domain instance. Should return null if no action taken.
    • modifyMap

      @Nullable public <D, P> D modifyMap(D repositoryDomain, P businessDomain, @Nullable ContextInfo contextInfo, boolean allowNull)
      Description copied from interface: DomainMapper
      Perform a mapping operation from business domain instance to persistence specific instance, presumably modifying the state of the persistence specific instance.
      Specified by:
      modifyMap in interface DomainMapper
      Type Parameters:
      D - The repository domain type
      P - The business domain type
      Parameters:
      repositoryDomain - The persistence domain instance to modify
      businessDomain - The business instance containing changes to map to the repository domain
      contextInfo - The context information used to make tracking determinations relevant to sandboxing and multitenant concerns. See TrackableRepository for more info on persistence behavior based on context.
      allowNull - Whether or not null values in properties in the payload instance should be ignored during the mapping operation.
      Returns:
      The modified repository domain instance. Return null if no action taken.
    • deleteMap

      @Nullable public <D> D deleteMap(D repositoryDomain, @Nullable ContextInfo contextInfo)
      Description copied from interface: DomainMapper
      In cases where deletion actually results in a modified state to persist (e.g. archived soft delete), this method will modify the state appropriately toward that end.
      Specified by:
      deleteMap in interface DomainMapper
      Type Parameters:
      D - The repository domain type
      Parameters:
      repositoryDomain - The persistence domain instance to inactivate
      contextInfo - The context information used to make tracking determinations relevant to sandboxing and multitenant concerns.
      Returns:
      The repository domain state resulting from the delete operation. Return null if no action taken.
    • mapInternal

      @Nullable protected <D> D mapInternal(@Nullable D repositoryDomain, @Nullable ContextInfo contextInfo)
    • isSupported

      protected boolean isSupported(@Nullable Object repositoryDomain, @Nullable ContextInfo contextInfo)
    • initializeState

      protected void initializeState(com.broadleafcommerce.common.messaging.notification.domain.NotificationState state)
      Initializes the given state such that NotificationManager.handle(NotificationStateRepository, NotificationStateAware, String) can be called for its NotificationState.getMessageType().
      Parameters:
      state - the state that should be initialized
    • getNotificationStateService

      protected com.broadleafcommerce.common.messaging.notification.NotificationStateService getNotificationStateService()
    • getSingleIndexRequestMessageFactory

      @Nullable protected SingleIndexRequestMessageFactory getSingleIndexRequestMessageFactory()