Class OutboundSyncState
java.lang.Object
de.hybris.platform.outboundsync.job.impl.OutboundSyncState
Represents state of a single outbound sync cron job run.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescription@NotNull PerformResultRepresents this state asPerformResultboolean@NotNull CronJobResultRetrieves current result of the outbound sync job.@NotNull CronJobStatusRetrieves current status of the outbound sync job.Retrieves the outbound sync job end time.intRetrieves number of changes reported by the delta detect that failed to synchronize.Retrieves number of items that have not been processed by the outbound sync yet and not included in this state.@NotNull DateRetrieves the outbound sync job start timeintRetrieves number of changes reported by the delta detect that synchronized successfully.@NotNull OptionalIntRetrieves total number of changes to by synchronized to an external system.intRetrieves number of changes, reported by the delta detect, ignored after the job was aborted.inthashCode()booleanDetermines whether the outbound sync job is abortedbooleanDetermines whether all changes detected by the outbound sync job have been processed or not.booleanisChangedFrom(OutboundSyncState prevState) Determines whether the job state changed beyond just a count change.booleanisFinal()Determines whether this state is final or not.booleanDetermines whether there is a systemic error which cannot be recovered.toString()
-
Method Details
-
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; elsefalse
-
isSystemicError
public boolean isSystemicError()Determines whether there is a systemic error which cannot be recovered. A systemic error is an error that does not depend on a specific item but would happen for any item being synchronized.- Returns:
true, if a systemic error exists; elsefalse
-
isFinal
public boolean isFinal()Determines whether this state is final or not.- Returns:
true, if this state is final, i.e. job has finished and the result is already known;false, if the outbound sync continues processing.
-
getTotalItemsRequested
Retrieves total number of changes to by synchronized to an external system.- Returns:
Optionalcontaining total number of changes, or an emptyOptional, 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.
-
getRemainingItemsCount
Retrieves number of items that have not been processed by the outbound sync yet and not included in this state.- Returns:
- difference between the total number of items collected by the delta detect and successfully processed items, items
processed with errors, and unprocessed items,
i.e.
getTotalItemsRequested() - getSuccessCount() - getErrorCount() - getUnprocessedCount(). IfgetTotalItemsRequested()is empty, then this method also returns anOptionalInt.empty()
-
getStartTime
Retrieves the outbound sync job start time- Returns:
- time when the job started.
-
getEndTime
Retrieves the outbound sync job end time.- Returns:
- time when the job finished, i.e. all changes are processed. This value may be
nullwhile the job is still running.
-
getCronJobStatus
Retrieves current status of the outbound sync job.- Returns:
- current status of the job
-
getCronJobResult
Retrieves current result of the outbound sync job.- Returns:
- current result of the job. The result is
CronJobResult.UNKNOWNwhile the job is still running. Once the job is finished or aborted, the result becomes eitherCronJobResult.ERRORorCronJobResult.SUCCESSdepending on whether errors are present or not, i.e.getErrorCount() > 0.
-
asPerformResult
Represents this state asPerformResult- Returns:
- this state as
PerformResult
-
toString
-
equals
-
hashCode
public int hashCode() -
isChangedFrom
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.
-
OutboundSyncStateBuilderinstead.