Class InventoryEntryTransformServiceImpl
- java.lang.Object
-
- com.commercetools.sync.services.impl.BaseTransformServiceImpl
-
- com.commercetools.sync.inventories.service.impl.InventoryEntryTransformServiceImpl
-
- All Implemented Interfaces:
InventoryEntryTransformService
public class InventoryEntryTransformServiceImpl extends BaseTransformServiceImpl implements InventoryEntryTransformService
-
-
Field Summary
-
Fields inherited from class com.commercetools.sync.services.impl.BaseTransformServiceImpl
CHUNK_SIZE, KEY_IS_NOT_SET_PLACE_HOLDER, referenceIdToKeyCache
-
-
Constructor Summary
Constructors Constructor Description InventoryEntryTransformServiceImpl(io.sphere.sdk.client.SphereClient ctpClient, ReferenceIdToKeyCache referenceIdToKeyCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft>>
toInventoryEntryDrafts(java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
Transforms InventoryEntries by resolving the references and map them to InventoryEntryDrafts.-
Methods inherited from class com.commercetools.sync.services.impl.BaseTransformServiceImpl
cacheResourceReferenceKeys, cacheResourceReferenceKeys, createResourceIdsGraphQlRequests, fetchAndFillReferenceIdToKeyCache, getCtpClient, getNonCachedReferenceIds
-
-
-
-
Constructor Detail
-
InventoryEntryTransformServiceImpl
public InventoryEntryTransformServiceImpl(@Nonnull io.sphere.sdk.client.SphereClient ctpClient, @Nonnull ReferenceIdToKeyCache referenceIdToKeyCache)
-
-
Method Detail
-
toInventoryEntryDrafts
@Nonnull public java.util.concurrent.CompletableFuture<java.util.List<io.sphere.sdk.inventory.InventoryEntryDraft>> toInventoryEntryDrafts(@Nonnull java.util.List<io.sphere.sdk.inventory.InventoryEntry> inventoryEntries)
Description copied from interface:InventoryEntryTransformService
Transforms InventoryEntries by resolving the references and map them to InventoryEntryDrafts.This method resolves(fetch key values for the reference id's) non null and unexpanded references of the InventoryEntry
InventoryEntry
by using cache.If the reference ids are already cached, key values are pulled from the cache, otherwise it executes the query to fetch the key value for the reference id's and store the idToKey value pair in the cache for reuse.
Then maps the InventoryEntry to InventoryEntryDraft by performing reference resolution considering idToKey value from the cache.
- Specified by:
toInventoryEntryDrafts
in interfaceInventoryEntryTransformService
- Parameters:
inventoryEntries
- the inventoryEntries to resolve the references.- Returns:
- a new list which contains InventoryEntryDrafts which have all their references resolved.
-
-