Class CategorySync


  • public class CategorySync
    extends BaseSync<com.commercetools.api.models.category.Category,​com.commercetools.api.models.category.CategoryDraft,​com.commercetools.api.models.category.CategoryUpdateAction,​CategorySyncStatistics,​CategorySyncOptions>
    • Constructor Detail

      • CategorySync

        public CategorySync​(@Nonnull
                            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.
        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<com.commercetools.api.models.category.CategoryDraft> categoryDrafts)
        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 class BaseSync<com.commercetools.api.models.category.Category,​com.commercetools.api.models.category.CategoryDraft,​com.commercetools.api.models.category.CategoryUpdateAction,​CategorySyncStatistics,​CategorySyncOptions>
        Parameters:
        categoryDrafts - the list of new resources as drafts.
        Returns:
        an instance of CompletionStage<SyncStatisticsT> which contains as a result an instance of SyncStatisticsT which is a subclass of BaseSyncStatistics representing the statistics instance attribute of this BaseSync.
      • processBatch

        protected java.util.concurrent.CompletionStage<CategorySyncStatistics> processBatch​(@Nonnull
                                                                                            java.util.List<com.commercetools.api.models.category.CategoryDraft> categoryDrafts)
        Specified by:
        processBatch in class BaseSync<com.commercetools.api.models.category.Category,​com.commercetools.api.models.category.CategoryDraft,​com.commercetools.api.models.category.CategoryUpdateAction,​CategorySyncStatistics,​CategorySyncOptions>