Class OutboundSyncJobStateAggregator
- java.lang.Object
-
- de.hybris.platform.outboundsync.job.impl.OutboundSyncJobStateAggregator
-
- All Implemented Interfaces:
OutboundSyncJob
public class OutboundSyncJobStateAggregator extends java.lang.Object implements OutboundSyncJob
This aggregator keeps track of an outbound sync job by aggregatingOutboundSyncEvents indicating the job progress.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStateObserver(OutboundSyncStateObserver observer)Registers an observer to be notified whenever this aggregate state changes, i.e.<T extends OutboundSyncEvent>
voidapplyEvent(T event)Applies an event and recalculates state of the context outbound sync job.static OutboundSyncJobStateAggregatorcreate(@NotNull OutboundSyncCronJobModel model)Instantiates this state aggregator.OutboundSyncStategetCurrentState()Retrieves state of the context job after the last event was applied.
-
-
-
Method Detail
-
create
public static OutboundSyncJobStateAggregator create(@NotNull @NotNull OutboundSyncCronJobModel model)
Instantiates this state aggregator.- Parameters:
model- a job model representing the cron job, for which state has to be managed by this aggregator.
-
applyEvent
public <T extends OutboundSyncEvent> void applyEvent(T event)
Description copied from interface:OutboundSyncJobApplies an event and recalculates state of the context outbound sync job.- Specified by:
applyEventin interfaceOutboundSyncJob- Parameters:
event- a job state changing event.
-
getCurrentState
public OutboundSyncState getCurrentState()
Description copied from interface:OutboundSyncJobRetrieves state of the context job after the last event was applied.- Specified by:
getCurrentStatein interfaceOutboundSyncJob- Returns:
- current state of the context outbound sync job.
-
addStateObserver
public void addStateObserver(OutboundSyncStateObserver observer)
Registers an observer to be notified whenever this aggregate state changes, i.e. the cron job status changes, cron job result changes orStartedOutboundSyncEventwas applied.- Specified by:
addStateObserverin interfaceOutboundSyncJob- Parameters:
observer- an observer to notify
-
-