Class OutboundSyncState


  • @Immutable
    public final class OutboundSyncState
    extends java.lang.Object
    Represents state of a single outbound sync cron job run.
    • Method Detail

      • isAllItemsProcessed

        public boolean isAllItemsProcessed()
        Determines whether all changes detected by the outbound sync job have been processed or not.
        Returns:
        true, if all changes are processed; false, if at least one change remains queued and not processed.
      • isAborted

        public boolean isAborted()
        Determines whether the outbound sync job is aborted
        Returns:
        true, if outbound sync job is aborted; else false
      • isSystemicError

        public boolean isSystemicError()
        Determines whether there is a systemic error which cannot be recovered
        Returns:
        true, if a systemic error exists; else false
      • getTotalItemsRequested

        @NotNull
        public @NotNull java.util.OptionalInt getTotalItemsRequested()
        Retrieves total number of changes to by synchronized to an external system.
        Returns:
        Optional containing total number of changes, or an empty Optional, if the total number of changes is not known yet.
      • getSuccessCount

        public int getSuccessCount()
        Retrieves number of changes reported by the delta detect that synchronized successfully.
        Returns:
        number of successfully synchronized changes or 0 when all items failed to synchronize or the job is aborted before any item synchronized successfully.
      • getErrorCount

        public int getErrorCount()
        Retrieves number of changes reported by the delta detect that failed to synchronize.
        Returns:
        number of failed to synchronize changes or 0, if all items synchronized successfully or the job was aborted before any item failed to synchronize.
      • getUnprocessedCount

        public int getUnprocessedCount()
        Retrieves number of changes, reported by the delta detect, ignored after the job was aborted.
        Returns:
        number of changes ignored or 0, if the job was not aborted.
      • getStartTime

        @NotNull
        public @NotNull java.util.Date getStartTime()
        Retrieves the outbound sync job start time
        Returns:
        time when the job started.
      • getEndTime

        public java.util.Date getEndTime()
        Retrieves the outbound sync job end time.
        Returns:
        time when the job finished, i.e. all changes are processed. This value may be null while the job is still running.
      • getCronJobStatus

        @NotNull
        public @NotNull CronJobStatus getCronJobStatus()
        Retrieves current status of the outbound sync job.
        Returns:
        current status of the job
      • getCronJobResult

        @NotNull
        public @NotNull CronJobResult getCronJobResult()
        Retrieves current result of the outbound sync job.
        Returns:
        current result of the job. The result is CronJobResult.UNKNOWN while the job is still running. Once the job is finished or aborted, the result becomes either CronJobResult.ERROR or CronJobResult.SUCCESS depending on whether errors are present or not, i.e. getErrorCount() > 0.
      • asPerformResult

        @NotNull
        public @NotNull PerformResult asPerformResult()
        Represents this state as PerformResult
        Returns:
        this state as PerformResult
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isChangedFrom

        public boolean isChangedFrom​(OutboundSyncState prevState)
        Determines whether the job state changed beyond just a count change.
        Parameters:
        prevState - a previous state to compare with
        Returns:
        true, if the job status, the job result or number of total items to process changed; false, if these states are identical or only already changed count got incremented.