Package com.commercetools.sync.states
Class StateSync
- java.lang.Object
-
- com.commercetools.sync.commons.BaseSync<io.sphere.sdk.states.StateDraft,StateSyncStatistics,StateSyncOptions>
-
- com.commercetools.sync.states.StateSync
-
public class StateSync extends BaseSync<io.sphere.sdk.states.StateDraft,StateSyncStatistics,StateSyncOptions>
-
-
Field Summary
-
Fields inherited from class com.commercetools.sync.commons.BaseSync
statistics, syncOptions
-
-
Constructor Summary
Constructors Constructor Description StateSync(StateSyncOptions stateSyncOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.CompletionStage<StateSyncStatistics>
process(java.util.List<io.sphere.sdk.states.StateDraft> resourceDrafts)
Given a list of resource (e.g.protected java.util.concurrent.CompletionStage<StateSyncStatistics>
processBatch(java.util.List<io.sphere.sdk.states.StateDraft> batch)
-
Methods inherited from class com.commercetools.sync.commons.BaseSync
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, sync, syncBatches
-
-
-
-
Constructor Detail
-
StateSync
public StateSync(@Nonnull StateSyncOptions stateSyncOptions)
-
-
Method Detail
-
process
protected java.util.concurrent.CompletionStage<StateSyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.states.StateDraft> resourceDrafts)
Description copied from class:BaseSync
Given a list of resource (e.g. categories, products, etc..) drafts. This method compares each new resource in this list with it's corresponding old resource in a given CTP project, and in turn it either issues update actions on the existing resource if it exists or create it if it doesn't.- Specified by:
process
in classBaseSync<io.sphere.sdk.states.StateDraft,StateSyncStatistics,StateSyncOptions>
- Parameters:
resourceDrafts
- the list of new resources as drafts.- Returns:
- an instance of
CompletionStage
<U
> which contains as a result an instance ofU
which is a subclass ofBaseSyncStatistics
representing thestatistics
instance attribute ofthis
BaseSync
.
-
processBatch
protected java.util.concurrent.CompletionStage<StateSyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.states.StateDraft> batch)
- Specified by:
processBatch
in classBaseSync<io.sphere.sdk.states.StateDraft,StateSyncStatistics,StateSyncOptions>
-
-