Class AbstractAutoStatusChangeListener<E>
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.messaging.AbstractAutoStatusChangeListener<E>
-
- Type Parameters:
E
- The type of event contained in the message
- Direct Known Subclasses:
AbstractAutoStatusChangeOrderCreatedListener
,AutoFulfillPaymentCapturedListener
public abstract class AbstractAutoStatusChangeListener<E> extends Object
Supports listening for an event and automatically changing the status of specific fulfillment(s).
-
-
Constructor Summary
Constructors Constructor Description AbstractAutoStatusChangeListener(com.broadleafcommerce.common.extension.TypeFactory typeFactory, FulfillmentOperationService fulfillmentOperationService, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.broadleafcommerce.data.tracking.core.context.ContextInfo
getContextInfo(E event)
protected FulfillmentOperationService
getFulfillmentOperationService()
protected abstract List<com.broadleafcommerce.order.client.domain.OrderFulfillment>
getFulfillments(E event)
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
getIdempotentMessageService()
protected abstract com.broadleafcommerce.order.client.domain.OrderFulfillmentStatus
getNewStatus()
protected abstract com.broadleafcommerce.order.client.domain.Order
getOrder(E event)
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
protected void
performChangeStatus(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
void
processEvent(@NonNull org.springframework.messaging.Message<E> message)
protected abstract boolean
shouldChangeStatus(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.order.client.domain.Order order)
Determine whether or not theOrderFulfillment
should automatically change status.
-
-
-
Constructor Detail
-
AbstractAutoStatusChangeListener
public AbstractAutoStatusChangeListener(com.broadleafcommerce.common.extension.TypeFactory typeFactory, FulfillmentOperationService fulfillmentOperationService, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService)
-
-
Method Detail
-
processEvent
public void processEvent(@NonNull @NonNull org.springframework.messaging.Message<E> message)
-
getFulfillments
protected abstract List<com.broadleafcommerce.order.client.domain.OrderFulfillment> getFulfillments(E event)
-
getOrder
protected abstract com.broadleafcommerce.order.client.domain.Order getOrder(E event)
-
getContextInfo
@Nullable protected abstract com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfo(E event)
-
shouldChangeStatus
protected abstract boolean shouldChangeStatus(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.order.client.domain.Order order)
Determine whether or not theOrderFulfillment
should automatically change status.- Parameters:
fulfillment
- The fulfillment to possibly change status- Returns:
- whether the fulfillment should change status
-
performChangeStatus
protected void performChangeStatus(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getNewStatus
protected abstract com.broadleafcommerce.order.client.domain.OrderFulfillmentStatus getNewStatus()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getFulfillmentOperationService
protected FulfillmentOperationService getFulfillmentOperationService()
-
getIdempotentMessageService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService()
-
-