public class CartDiscountSync extends BaseSync<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncStatistics,CartDiscountSyncOptions>
statistics, syncOptions
Constructor and Description |
---|
CartDiscountSync(CartDiscountSyncOptions cartDiscountSyncOptions)
Takes a
CartDiscountSyncOptions to instantiate a new CartDiscountSync instance
that could be used to sync cart discount drafts in the CTP project specified in the injected
CartDiscountSyncOptions instance. |
Modifier and Type | Method and Description |
---|---|
protected java.util.concurrent.CompletionStage<CartDiscountSyncStatistics> |
process(java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> cartDiscountDrafts)
Iterates through the whole
cartDiscountDrafts list and accumulates its valid drafts to
batches. |
protected java.util.concurrent.CompletionStage<CartDiscountSyncStatistics> |
processBatch(java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> batch) |
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, sync, syncBatches
public CartDiscountSync(@Nonnull CartDiscountSyncOptions cartDiscountSyncOptions)
CartDiscountSyncOptions
to instantiate a new CartDiscountSync
instance
that could be used to sync cart discount drafts in the CTP project specified in the injected
CartDiscountSyncOptions
instance.cartDiscountSyncOptions
- the container of all the options of the sync process including
the CTP project client and/or configuration and other sync-specific options.protected java.util.concurrent.CompletionStage<CartDiscountSyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> cartDiscountDrafts)
cartDiscountDrafts
list and accumulates its valid drafts to
batches. Every batch is then processed by processBatch(List)
.
Inherited doc: 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.
process
in class BaseSync<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncStatistics,CartDiscountSyncOptions>
cartDiscountDrafts
- List
of CartDiscountDraft
's that would be synced into
CTP project.CompletionStage
with CartDiscountSyncStatistics
holding statistics of
all sync processes performed by this sync instance.protected java.util.concurrent.CompletionStage<CartDiscountSyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.cartdiscounts.CartDiscountDraft> batch)
processBatch
in class BaseSync<io.sphere.sdk.cartdiscounts.CartDiscountDraft,CartDiscountSyncStatistics,CartDiscountSyncOptions>