Class InventoryServiceImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.github.benmanes.caffeine.cache.Cache<java.lang.String,​java.lang.String> keyToIdCache  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletionStage<java.util.Optional<io.sphere.sdk.inventory.InventoryEntry>> createInventoryEntry​(io.sphere.sdk.inventory.InventoryEntryDraft inventoryEntryDraft)
      Creates new inventory entry from inventoryEntryDraft.
      java.util.concurrent.CompletionStage<java.util.Set<io.sphere.sdk.inventory.InventoryEntry>> fetchInventoryEntriesBySkus​(java.util.Set<java.lang.String> skus)
      Queries existing InventoryEntry's against set of skus.
      java.util.concurrent.CompletionStage<io.sphere.sdk.inventory.InventoryEntry> updateInventoryEntry​(io.sphere.sdk.inventory.InventoryEntry inventoryEntry, java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> updateActions)
      Updates existing inventory entry with updateActions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • keyToIdCache

        protected final com.github.benmanes.caffeine.cache.Cache<java.lang.String,​java.lang.String> keyToIdCache
    • Constructor Detail

    • Method Detail

      • fetchInventoryEntriesBySkus

        @Nonnull
        public java.util.concurrent.CompletionStage<java.util.Set<io.sphere.sdk.inventory.InventoryEntry>> fetchInventoryEntriesBySkus​(@Nonnull
                                                                                                                                       java.util.Set<java.lang.String> skus)
        Description copied from interface: InventoryService
        Queries existing InventoryEntry's against set of skus.
        Specified by:
        fetchInventoryEntriesBySkus in interface InventoryService
        Parameters:
        skus - Set of sku values, used in search predicate
        Returns:
        List of matching entries or empty list when there was no entry of sku matching to skus.
      • createInventoryEntry

        @Nonnull
        public java.util.concurrent.CompletionStage<java.util.Optional<io.sphere.sdk.inventory.InventoryEntry>> createInventoryEntry​(@Nonnull
                                                                                                                                     io.sphere.sdk.inventory.InventoryEntryDraft inventoryEntryDraft)
        Description copied from interface: InventoryService
        Creates new inventory entry from inventoryEntryDraft.
        Specified by:
        createInventoryEntry in interface InventoryService
        Parameters:
        inventoryEntryDraft - draft with data for new inventory entry
        Returns:
        CompletionStage with created InventoryEntry or an exception
      • updateInventoryEntry

        @Nonnull
        public java.util.concurrent.CompletionStage<io.sphere.sdk.inventory.InventoryEntry> updateInventoryEntry​(@Nonnull
                                                                                                                 io.sphere.sdk.inventory.InventoryEntry inventoryEntry,
                                                                                                                 @Nonnull
                                                                                                                 java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.inventory.InventoryEntry>> updateActions)
        Description copied from interface: InventoryService
        Updates existing inventory entry with updateActions.
        Specified by:
        updateInventoryEntry in interface InventoryService
        Parameters:
        inventoryEntry - entry that should be updated
        updateActions - List of actions that should be applied to inventoryEntry
        Returns:
        CompletionStage with updated InventoryEntry or an exception