public class ProductSync extends BaseSync<io.sphere.sdk.products.ProductDraft,ProductSyncStatistics,ProductSyncOptions>
statistics, syncOptions| Constructor and Description |
|---|
ProductSync(ProductSyncOptions productSyncOptions)
Takes a
ProductSyncOptions instance to instantiate a new ProductSync instance that could be
used to sync product drafts with the given products in the CTP project specified in the injected
ProductSyncOptions instance. |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.concurrent.CompletionStage<ProductSyncStatistics> |
process(java.util.List<io.sphere.sdk.products.ProductDraft> resourceDrafts)
Given a list of resource (e.g.
|
protected java.util.concurrent.CompletionStage<ProductSyncStatistics> |
processBatch(java.util.List<io.sphere.sdk.products.ProductDraft> batch) |
protected java.util.concurrent.CompletionStage<ProductSyncStatistics> |
syncBatches(java.util.List<java.util.List<io.sphere.sdk.products.ProductDraft>> batches,
java.util.concurrent.CompletionStage<ProductSyncStatistics> result)
Given a list of resource (e.g.
|
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, syncpublic ProductSync(@Nonnull
ProductSyncOptions productSyncOptions)
ProductSyncOptions instance to instantiate a new ProductSync instance that could be
used to sync product drafts with the given products in the CTP project specified in the injected
ProductSyncOptions instance.productSyncOptions - 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<ProductSyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.products.ProductDraft> resourceDrafts)
BaseSyncprocess in class BaseSync<io.sphere.sdk.products.ProductDraft,ProductSyncStatistics,ProductSyncOptions>resourceDrafts - the list of new resources as drafts.CompletionStage<U> which contains as a result an instance of
U which is a subclass of BaseSyncStatistics representing the statistics instance
attribute of this BaseSync.protected java.util.concurrent.CompletionStage<ProductSyncStatistics> syncBatches(@Nonnull java.util.List<java.util.List<io.sphere.sdk.products.ProductDraft>> batches, @Nonnull java.util.concurrent.CompletionStage<ProductSyncStatistics> result)
BaseSyncList<List> of resources, this method recursively calls
BaseSync.processBatch(List) on each batch, then removes it, until there are no more batches, in other words,
all batches have been synced.syncBatches in class BaseSync<io.sphere.sdk.products.ProductDraft,ProductSyncStatistics,ProductSyncOptions>batches - the batches of resources to sync.result - in the first call of this recursive method, this result is normally a completed future, it
used from within the method to recursively sync each batch once the previous batch has
finished syncing.CompletionStage<U> which contains as a result an instance of
BaseSyncStatistics representing the statistics of the sync process executed on the
given list of batches.protected java.util.concurrent.CompletionStage<ProductSyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.products.ProductDraft> batch)
processBatch in class BaseSync<io.sphere.sdk.products.ProductDraft,ProductSyncStatistics,ProductSyncOptions>