Class CategorySync
- java.lang.Object
 - 
- com.commercetools.sync.commons.BaseSync<io.sphere.sdk.categories.CategoryDraft,io.sphere.sdk.categories.Category,CategorySyncStatistics,CategorySyncOptions>
 - 
- com.commercetools.sync.categories.CategorySync
 
 
 
- 
public class CategorySync extends BaseSync<io.sphere.sdk.categories.CategoryDraft,io.sphere.sdk.categories.Category,CategorySyncStatistics,CategorySyncOptions>
 
- 
- 
Field Summary
- 
Fields inherited from class com.commercetools.sync.commons.BaseSync
statistics, syncOptions 
 - 
 
- 
Constructor Summary
Constructors Constructor Description CategorySync(CategorySyncOptions syncOptions)Takes aCategorySyncOptionsinstance to instantiate a newCategorySyncinstance that could be used to sync category drafts with the given categories in the CTP project specified in the injectedCategorySyncOptionsinstance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.CompletionStage<CategorySyncStatistics>process(java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)Given a list of resource (e.g.protected java.util.concurrent.CompletionStage<CategorySyncStatistics>processBatch(java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)- 
Methods inherited from class com.commercetools.sync.commons.BaseSync
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, handleError, sync, syncBatches 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
CategorySync
public CategorySync(@Nonnull CategorySyncOptions syncOptions)Takes aCategorySyncOptionsinstance to instantiate a newCategorySyncinstance that could be used to sync category drafts with the given categories in the CTP project specified in the injectedCategorySyncOptionsinstance.- Parameters:
 syncOptions- the container of all the options of the sync process including the CTP project client and/or configuration and other sync-specific options.
 
 - 
 
- 
Method Detail
- 
process
protected java.util.concurrent.CompletionStage<CategorySyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
Description copied from class:BaseSyncGiven 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:
 processin classBaseSync<io.sphere.sdk.categories.CategoryDraft,io.sphere.sdk.categories.Category,CategorySyncStatistics,CategorySyncOptions>- Parameters:
 categoryDrafts- the list of new resources as drafts.- Returns:
 - an instance of 
CompletionStage<U> which contains as a result an instance ofUwhich is a subclass ofBaseSyncStatisticsrepresenting thestatisticsinstance attribute ofthisBaseSync. 
 
- 
processBatch
protected java.util.concurrent.CompletionStage<CategorySyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.categories.CategoryDraft> categoryDrafts)
- Specified by:
 processBatchin classBaseSync<io.sphere.sdk.categories.CategoryDraft,io.sphere.sdk.categories.Category,CategorySyncStatistics,CategorySyncOptions>
 
 - 
 
 -