Class ProductSync

    • Constructor Detail

      • ProductSync

        public ProductSync​(@Nonnull
                           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.
        Parameters:
        productSyncOptions - 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<ProductSyncStatistics> process​(@Nonnull
                                                                                      java.util.List<io.sphere.sdk.products.ProductDraft> resourceDrafts)
        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<io.sphere.sdk.products.ProductDraft,​ProductSyncStatistics,​ProductSyncOptions>
        Parameters:
        resourceDrafts - the list of new resources as drafts.
        Returns:
        an instance of 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.