Interface OutboundSyncJob
-
- All Known Implementing Classes:
OutboundSyncJobStateAggregator
public interface OutboundSyncJobAn object controlling and representing state of a single outbound sync job. Implementations make decisions about whether the job is finished and what's the result of the job execution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddStateObserver(@NotNull OutboundSyncStateObserver observer)Registers a state observer.<T extends OutboundSyncEvent>
voidapplyEvent(T event)Applies an event and recalculates state of the context outbound sync job.@NotNull OutboundSyncStategetCurrentState()Retrieves state of the context job after the last event was applied.
-
-
-
Method Detail
-
applyEvent
<T extends OutboundSyncEvent> void applyEvent(@NotNull T event)
Applies an event and recalculates state of the context outbound sync job.- Parameters:
event- a job state changing event.
-
getCurrentState
@NotNull @NotNull OutboundSyncState getCurrentState()
Retrieves state of the context job after the last event was applied.- Returns:
- current state of the context outbound sync job.
-
addStateObserver
void addStateObserver(@NotNull @NotNull OutboundSyncStateObserver observer)Registers a state observer.- Parameters:
observer- an observer that is going to be notified whenever the job state changes.
-
-