public class CategorySync extends BaseSync<io.sphere.sdk.categories.CategoryDraft,CategorySyncStatistics,CategorySyncOptions>
statistics, syncOptions| Constructor and Description |
|---|
CategorySync(CategorySyncOptions syncOptions)
Takes a
CategorySyncOptions instance to instantiate a new CategorySync instance that could be
used to sync category drafts with the given categories in the CTP project specified in the injected
CategorySyncOptions instance. |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.concurrent.CompletionStage<CategorySyncStatistics> |
process(java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
Given a list of
CategoryDraft that represent a batch of category drafts, this method for the first batch
only caches a list of all the categories in the CTP project in a cached map that representing each category's
key to the id. |
protected java.util.concurrent.CompletionStage<CategorySyncStatistics> |
processBatch(java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
Given a list of
CategoryDraft that represent a batch of category drafts, this method for the first batch
only caches a list of all the categories in the CTP project in a cached map that representing each category's
key to the id. |
protected java.util.concurrent.CompletionStage<CategorySyncStatistics> |
syncBatches(java.util.List<java.util.List<io.sphere.sdk.categories.CategoryDraft>> batches,
java.util.concurrent.CompletionStage<CategorySyncStatistics> result)
Given a list of resource (e.g.
|
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, syncpublic CategorySync(@Nonnull
CategorySyncOptions syncOptions)
CategorySyncOptions instance to instantiate a new CategorySync instance that could be
used to sync category drafts with the given categories in the CTP project specified in the injected
CategorySyncOptions instance.syncOptions - 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<CategorySyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
CategoryDraft that represent a batch of category drafts, this method for the first batch
only caches a list of all the categories in the CTP project in a cached map that representing each category's
key to the id. It then validates the category drafts, then resolves all the references. Then it creates all
categories that need to be created in parallel while keeping track of the categories that have their
non-existing parents. Then it does update actions that don't require parent changes in parallel. Then in a
blocking fashion issues update actions that don't involve parent changes sequentially.
More on the exact implementation of how the sync works here: https://sphere.atlassian.net/wiki/spaces/PS/pages/145193124/Category+Parallelisation+Technical+Concept
process in class BaseSync<io.sphere.sdk.categories.CategoryDraft,CategorySyncStatistics,CategorySyncOptions>categoryDrafts - the list of new category drafts to sync to the CTP project.CompletionStage<CategorySyncStatistics> which contains as a result
an instance of CategorySyncStatistics representing the statistics instance attribute of
this CategorySync.protected java.util.concurrent.CompletionStage<CategorySyncStatistics> syncBatches(@Nonnull java.util.List<java.util.List<io.sphere.sdk.categories.CategoryDraft>> batches, @Nonnull java.util.concurrent.CompletionStage<CategorySyncStatistics> 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.categories.CategoryDraft,CategorySyncStatistics,CategorySyncOptions>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<CategorySyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
CategoryDraft that represent a batch of category drafts, this method for the first batch
only caches a list of all the categories in the CTP project in a cached map that representing each category's
key to the id. It then validates the category drafts, then resolves all the references. Then it creates all
categories that need to be created in parallel while keeping track of the categories that have their
non-existing parents. Then it does update actions that don't require parent changes in parallel. Then in a
blocking fashion issues update actions that don't involve parent changes sequentially.
More on the exact implementation of how the sync works here: https://github.com/commercetools/commercetools-sync-java/wiki/Category-Sync-Underlying-Concept
processBatch in class BaseSync<io.sphere.sdk.categories.CategoryDraft,CategorySyncStatistics,CategorySyncOptions>categoryDrafts - the list of new category drafts to sync to the CTP project.CompletionStage<CategorySyncStatistics> which contains as a result
an instance of CategorySyncStatistics representing the statistics instance attribute of
this CategorySync.