Class ShoppingListSync
- java.lang.Object
 - 
- com.commercetools.sync.commons.BaseSync<io.sphere.sdk.shoppinglists.ShoppingListDraft,io.sphere.sdk.shoppinglists.ShoppingList,ShoppingListSyncStatistics,ShoppingListSyncOptions>
 - 
- com.commercetools.sync.shoppinglists.ShoppingListSync
 
 
 
- 
public class ShoppingListSync extends BaseSync<io.sphere.sdk.shoppinglists.ShoppingListDraft,io.sphere.sdk.shoppinglists.ShoppingList,ShoppingListSyncStatistics,ShoppingListSyncOptions>
This class syncs shopping list drafts with corresponding shopping list resources in the CTP project. 
- 
- 
Field Summary
- 
Fields inherited from class com.commercetools.sync.commons.BaseSync
statistics, syncOptions 
 - 
 
- 
Constructor Summary
Constructors Modifier Constructor Description ShoppingListSync(ShoppingListSyncOptions shoppingListSyncOptions)Takes aShoppingListSyncOptionsto instantiate a newShoppingListSyncinstance that could be used to sync shopping list drafts in the CTP project specified in the injectedShoppingListSyncOptionsinstance.protectedShoppingListSync(ShoppingListSyncOptions syncOptions, ShoppingListService shoppingListService, CustomerService customerService, TypeService typeService)Takes aShoppingListSyncOptionsand service instances to instantiate a newShoppingListSyncinstance that could be used to sync shopping list drafts in the CTP project specified in the injectedShoppingListSyncOptionsinstance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.CompletionStage<ShoppingListSyncStatistics>process(java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> shoppingListDrafts)Iterates through the wholeShoppingListDraft's list and accumulates its valid drafts to batches.protected java.util.concurrent.CompletionStage<ShoppingListSyncStatistics>processBatch(java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> batch)- 
Methods inherited from class com.commercetools.sync.commons.BaseSync
executeSupplierIfConcurrentModificationException, getStatistics, getSyncOptions, handleError, sync, syncBatches 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
ShoppingListSync
public ShoppingListSync(@Nonnull ShoppingListSyncOptions shoppingListSyncOptions)Takes aShoppingListSyncOptionsto instantiate a newShoppingListSyncinstance that could be used to sync shopping list drafts in the CTP project specified in the injectedShoppingListSyncOptionsinstance.- Parameters:
 shoppingListSyncOptions- the container of all the options of the sync process including the CTP project client and/or configuration and other sync-specific options.
 
- 
ShoppingListSync
protected ShoppingListSync(@Nonnull ShoppingListSyncOptions syncOptions, @Nonnull ShoppingListService shoppingListService, @Nonnull CustomerService customerService, @Nonnull TypeService typeService)Takes aShoppingListSyncOptionsand service instances to instantiate a newShoppingListSyncinstance that could be used to sync shopping list drafts in the CTP project specified in the injectedShoppingListSyncOptionsinstance.NOTE: This constructor is mainly to be used for tests where the services can be mocked and passed to.
- 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.shoppingListService- the shopping list service which is responsible for fetching/caching the ShoppingLists from the CTP project.customerService- the customer service which is responsible for fetching/caching the Customers from the CTP project.typeService- the type service which is responsible for fetching/caching the Types from the CTP project.
 
 - 
 
- 
Method Detail
- 
process
protected java.util.concurrent.CompletionStage<ShoppingListSyncStatistics> process(@Nonnull java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> shoppingListDrafts)
Iterates through the wholeShoppingListDraft's list and accumulates its valid drafts to batches. Every batch is then processed byprocessBatch(List).Inherited doc: 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:
 processin classBaseSync<io.sphere.sdk.shoppinglists.ShoppingListDraft,io.sphere.sdk.shoppinglists.ShoppingList,ShoppingListSyncStatistics,ShoppingListSyncOptions>- Parameters:
 shoppingListDrafts-ListofShoppingListDraft's that would be synced into CTP project.- Returns:
 CompletionStagewithShoppingListSyncStatisticsholding statistics of all sync processes performed by this sync instance.
 
- 
processBatch
protected java.util.concurrent.CompletionStage<ShoppingListSyncStatistics> processBatch(@Nonnull java.util.List<io.sphere.sdk.shoppinglists.ShoppingListDraft> batch)
- Specified by:
 processBatchin classBaseSync<io.sphere.sdk.shoppinglists.ShoppingListDraft,io.sphere.sdk.shoppinglists.ShoppingList,ShoppingListSyncStatistics,ShoppingListSyncOptions>
 
 - 
 
 -