Interface OutboundSyncJob

  • All Known Implementing Classes:
    OutboundSyncJobStateAggregator

    public interface OutboundSyncJob
    An 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 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.