Package de.hybris.platform.stock
Interface StockService
-
- All Known Implementing Classes:
DefaultStockService
public interface StockServiceService for 'Stock Level Management'. It offers ...- updating Stock Levels (based on the specified
StockLevelModel. - searching for Stock Levels (based on the specified
StockLevelModel. - reserving and releasing Stock Levels (based on the specified
StockLevelModel. - checking for available amount (based on the specified
StockLevelModel.
- Spring Bean ID:
- stockService
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<StockLevelModel>getAllStockLevels(ProductModel product)Finds the stock levels of the specified product from all warehouses.java.lang.StringgetAvailability(ProductModel product, WarehouseModel warehouse, int quantity, LanguageModel language)Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouse as parameters.java.lang.StringgetAvailability(ProductModel product, WarehouseModel warehouse, java.util.Date date, LanguageModel language)Gets the available quantity of the product for the specified warehouse.java.lang.StringgetAvailability(ProductModel product, java.util.List<WarehouseModel> warehouses, int quantity, LanguageModel language)Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouses as parameters.java.lang.StringgetAvailability(ProductModel product, java.util.List<WarehouseModel> warehouses, java.util.Date date, LanguageModel language)Gets the available quantity of the product for the specified warehouses.java.util.Map<WarehouseModel,java.util.Date>getAvailability(java.util.List<WarehouseModel> warehouses, ProductModel product, int preOrderQuantity)Returns product availability, passing product, and quantity as parameters.java.util.Map<WarehouseModel,java.lang.Integer>getAvailability(java.util.List<WarehouseModel> warehouses, ProductModel product, java.util.Date date)Gets the product quantity for the specified product, warehouses and date.WarehouseModelgetBestMatchOfAvailability(java.util.Map<WarehouseModel,java.util.Date> map)Returns the warehouse which offers the "best" product "availability" .WarehouseModelgetBestMatchOfQuantity(java.util.Map<WarehouseModel,java.lang.Integer> map)Returns the warehouse which offers the "best" product "quantity".InStockStatusgetInStockStatus(ProductModel product, WarehouseModel warehouse)Checks the stock level status of the product in the specified warehouses.StockLevelStatusgetProductStatus(ProductModel product, WarehouseModel warehouse)Checks the stock level status of the product in the specified warehouse.StockLevelStatusgetProductStatus(ProductModel product, java.util.Collection<WarehouseModel> warehouses)Checks the stock level status of the product in all specified warehouses.StockLevelModelgetStockLevel(ProductModel product, WarehouseModel warehouse)Finds the stock level of the specified product at the specified warehouse.intgetStockLevelAmount(ProductModel product, WarehouseModel warehouse)Finds the stock level of the specified product in the specified warehouse, and calculates the actual available amount.java.util.Collection<StockLevelModel>getStockLevels(ProductModel product, java.util.Collection<WarehouseModel> warehouses)Finds all stock levels of the specified product in the specified warehouses.intgetTotalStockLevelAmount(ProductModel product)Finds the stock levels of the specified product from all warehouses, and calculates the total actual amount.intgetTotalStockLevelAmount(ProductModel product, java.util.Collection<WarehouseModel> warehouses)Finds all stock levels of the specified product in the specified warehouses, and calculates the total actual amount.voidrelease(ProductModel product, WarehouseModel warehouse, int amount, java.lang.String comment)Release the product in the specified warehouse.voidreserve(ProductModel product, WarehouseModel warehouse, int amount, java.lang.String comment)Reserves the product in the specified warehouse.voidsetInStockStatus(ProductModel product, java.util.Collection<WarehouseModel> warehouses, InStockStatus status)Sets the in stock status of all stock levels of the product in the specified warehouses.voidupdateActualStockLevel(ProductModel product, WarehouseModel warehouse, int actualAmount, java.lang.String comment)Updates the actual stock level of the specified product in the specified warehouse.
-
-
-
Field Detail
-
BEAN_NAME
static final java.lang.String BEAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProductStatus
StockLevelStatus getProductStatus(ProductModel product, WarehouseModel warehouse)
Checks the stock level status of the product in the specified warehouse.- Parameters:
product- the productwarehouse- warehouse of the product- Returns:
- stock level status
-
getProductStatus
StockLevelStatus getProductStatus(ProductModel product, java.util.Collection<WarehouseModel> warehouses)
Checks the stock level status of the product in all specified warehouses.- Parameters:
product- the productwarehouses- warehouses of the product- Returns:
- stock level status
-
getTotalStockLevelAmount
int getTotalStockLevelAmount(ProductModel product)
Finds the stock levels of the specified product from all warehouses, and calculates the total actual amount.- Parameters:
product- the product- Returns:
- calculated actual amount of the specified product
- Throws:
StockLevelNotFoundException- if no suchStockLevelModelcan be found
-
getTotalStockLevelAmount
int getTotalStockLevelAmount(ProductModel product, java.util.Collection<WarehouseModel> warehouses)
Finds all stock levels of the specified product in the specified warehouses, and calculates the total actual amount.- Parameters:
product- the productwarehouses- the warehouses- Returns:
- calculated actual amount of the specified product in the warehouses
- Throws:
StockLevelNotFoundException- if no suchStockLevelModelcan be found
-
getStockLevelAmount
int getStockLevelAmount(ProductModel product, WarehouseModel warehouse)
Finds the stock level of the specified product in the specified warehouse, and calculates the actual available amount.- Parameters:
product- the productwarehouse- warehouse of the product- Returns:
- actual available amount for the specific product
- Throws:
StockLevelNotFoundException- if no suchStockLevelModelcan be found
-
updateActualStockLevel
void updateActualStockLevel(ProductModel product, WarehouseModel warehouse, int actualAmount, java.lang.String comment)
Updates the actual stock level of the specified product in the specified warehouse.- Parameters:
product- the productwarehouse- the warehouse where product is 'stored'actualAmount- the actual amount of the productcomment- the comment for the update operation
-
reserve
void reserve(ProductModel product, WarehouseModel warehouse, int amount, java.lang.String comment) throws InsufficientStockLevelException
Reserves the product in the specified warehouse.- Parameters:
product- the productwarehouse- the warehouse where product is 'stored'amount- the amount of the reservationcomment- the comment for the reservation- Throws:
InsufficientStockLevelException- if not enough products are available in the stock
-
release
void release(ProductModel product, WarehouseModel warehouse, int amount, java.lang.String comment)
Release the product in the specified warehouse.- Parameters:
product- the productwarehouse- the warehouse where product is 'stored'amount- the amount of the releasecomment- the comment for the release
-
setInStockStatus
void setInStockStatus(ProductModel product, java.util.Collection<WarehouseModel> warehouses, InStockStatus status)
Sets the in stock status of all stock levels of the product in the specified warehouses.- Parameters:
product- the productwarehouses- the warehousesstatus- the in stock status
-
getInStockStatus
InStockStatus getInStockStatus(ProductModel product, WarehouseModel warehouse)
Checks the stock level status of the product in the specified warehouses.- Parameters:
product- the productwarehouse- the warehouse- Returns:
- the in stock status
-
getAvailability
java.lang.String getAvailability(ProductModel product, WarehouseModel warehouse, java.util.Date date, LanguageModel language)
Gets the available quantity of the product for the specified warehouse.- Parameters:
product- the productwarehouse- the warehousedate- the date the specified quantity has to be available at least (could be null).language- language for which the text should be localized- Returns:
- the configured availability text message
-
getAvailability
java.lang.String getAvailability(ProductModel product, java.util.List<WarehouseModel> warehouses, java.util.Date date, LanguageModel language)
Gets the available quantity of the product for the specified warehouses.- Parameters:
product- the productwarehouses- the warehousesdate- the date the specified quantity has to be available at least (could be null).language- language for which the text should be localized- Returns:
- the configured availability text message
-
getAvailability
java.lang.String getAvailability(ProductModel product, WarehouseModel warehouse, int quantity, LanguageModel language)
Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouse as parameters.- Parameters:
product- the productwarehouse- the warehousequantity- the asked quantitylanguage- language for which the text should be localized- Returns:
- String the configured availability text message
-
getAvailability
java.lang.String getAvailability(ProductModel product, java.util.List<WarehouseModel> warehouses, int quantity, LanguageModel language)
Gets availability date by invoking strategy for calculating product availability, passing product, quantity and warehouses as parameters.- Parameters:
product- the productwarehouses- the warehousesquantity- the asked quantitylanguage- language for which the text should be localized- Returns:
- the configured availability text message
-
getBestMatchOfQuantity
WarehouseModel getBestMatchOfQuantity(java.util.Map<WarehouseModel,java.lang.Integer> map)
Returns the warehouse which offers the "best" product "quantity".- Parameters:
map- the mapped quantities of a certain product- Returns:
- WarehouseModel best match
-
getBestMatchOfAvailability
WarehouseModel getBestMatchOfAvailability(java.util.Map<WarehouseModel,java.util.Date> map)
Returns the warehouse which offers the "best" product "availability" .- Parameters:
map- the mapped available dates of a certain product- Returns:
- WarehouseModel best match
-
getStockLevel
StockLevelModel getStockLevel(ProductModel product, WarehouseModel warehouse)
Finds the stock level of the specified product at the specified warehouse.- Parameters:
product- the productwarehouse- warehouse of the product- Returns:
- found stock level, and null if no such stock level can be found.
-
getAllStockLevels
java.util.Collection<StockLevelModel> getAllStockLevels(ProductModel product)
Finds the stock levels of the specified product from all warehouses.- Parameters:
product- the product- Returns:
- all found stock levels of product
-
getStockLevels
java.util.Collection<StockLevelModel> getStockLevels(ProductModel product, java.util.Collection<WarehouseModel> warehouses)
Finds all stock levels of the specified product in the specified warehouses.- Parameters:
product- the productwarehouses- the warehouses- Returns:
- found stock levels of the product
-
getAvailability
java.util.Map<WarehouseModel,java.lang.Integer> getAvailability(java.util.List<WarehouseModel> warehouses, ProductModel product, java.util.Date date)
Gets the product quantity for the specified product, warehouses and date.- Parameters:
warehouses- the warehousesproduct- the productdate- the date the specified quantity has to be available at least.- Returns:
- the mapped quantity
-
getAvailability
java.util.Map<WarehouseModel,java.util.Date> getAvailability(java.util.List<WarehouseModel> warehouses, ProductModel product, int preOrderQuantity)
Returns product availability, passing product, and quantity as parameters.- Parameters:
warehouses- the warehousesproduct- the productpreOrderQuantity- the asked min. preOrderQuantity- Returns:
- the date, when the questioned quantity will be available
-
-