public class SoapBean extends Object
Constructor and Description |
---|
SoapBean() |
Modifier and Type | Method and Description |
---|---|
ItemDto |
changeItem(long ean,
int currentCount,
String unit,
Integer alertThreshold)
Changes the parameters of an item
|
String |
exportAllItemsToXml()
Exports all items from DB
|
List<CategoryDto> |
getAllCategories()
Returns all categories
|
List<ItemDto> |
getAllItems()
Returns a list of all items in DB
|
List<ItemDto> |
getAllItemsForCategory(String categoryName)
Gets all items in category
|
CategoryDto |
getCategoryByName(String categoryName)
Get category by categoryName
|
List<OverviewResultCategory> |
getDailySalesForCategory(String category,
Date dayStart,
int numberOfDays)
Get daily count of sold items from given category.
|
String |
getDailySalesForCategoryXml(String category,
Date dayStart,
int numberOfDays)
Get daily count of sold items from given category.
|
List<OverviewResultItem> |
getDailySalesForItem(long ean,
Date dayStart,
int numberOfDays)
Get daily count of sold items.
|
String |
getDailySalesForItemXml(long ean,
Date dayStart,
int numberOfDays)
Get daily count of sold items.
|
List<OverviewResultCategory> |
getMonthlySalesForCategory(String category,
Date monthStart,
int numberOfMonths)
Get monthly count of sold items from given category.
|
String |
getMonthlySalesForCategoryXml(String category,
Date monthStart,
int numberOfMonths)
Get monthly count of sold items from given category.
|
List<OverviewResultItem> |
getMonthlySalesForItem(long ean,
Date monthStart,
int numberOfMonths)
Get monthly count of sold items.
|
String |
getMonthlySalesForItemXml(long ean,
Date monthStart,
int numberOfMonths)
Get monthly count of sold items.
|
List<OverviewResultCategory> |
getWeeklySalesForCategory(String category,
Date weekStart,
int numberOfWeeks)
Get weekly count of sold items from given category.
|
String |
getWeeklySalesForCategoryXml(String category,
Date weekStart,
int numberOfWeeks)
Get weekly count of sold items from given category.
|
List<OverviewResultItem> |
getWeeklySalesForItem(long ean,
Date weekStart,
int numberOfWeeks)
Get weekly count of sold items.
|
String |
getWeeklySalesForItemXml(long ean,
Date weekStart,
int numberOfWeeks)
Get weekly count of sold items.
|
void |
importXml(String xmlToImport)
Import XML
|
public void importXml(String xmlToImport) throws ServiceException, EntityDoesNotExistException, NotEnoughStoredException, XmlValidationException
xmlToImport
- encoded stringServiceException
- DB failureEntityDoesNotExistException
- no such item in DBNotEnoughStoredException
- import places stock in the negativeXmlValidationException
- invalid xmlpublic String exportAllItemsToXml() throws XmlValidationException
XmlValidationException
- on internal errorpublic List<ItemDto> getAllItemsForCategory(String categoryName) throws EntityDoesNotExistException
categoryName
- categoryNameEntityDoesNotExistException
- invalid categorypublic List<CategoryDto> getAllCategories()
public CategoryDto getCategoryByName(String categoryName)
categoryName
- categoryNamepublic ItemDto changeItem(long ean, int currentCount, String unit, Integer alertThreshold) throws ServiceException, EntityDoesNotExistException
ean
- eancurrentCount
- current item countunit
- unitalertThreshold
- alert thresholdServiceException
- on internal failureEntityDoesNotExistException
- no such entitypublic String getDailySalesForItemXml(long ean, Date dayStart, int numberOfDays) throws EntityDoesNotExistException, XmlValidationException
ean
- ean of item to find its salesdayStart
- date of the first day of the overviewnumberOfDays
- number of days of the overviewEntityDoesNotExistException
- if item does not existsXmlValidationException
- on invalid xmlpublic String getWeeklySalesForItemXml(long ean, Date weekStart, int numberOfWeeks) throws EntityDoesNotExistException, XmlValidationException
ean
- ean of item to find its salesweekStart
- date of some day from the first week of the overviewnumberOfWeeks
- number of weeks of the overviewEntityDoesNotExistException
- if item does not existsXmlValidationException
- on invalid xmlpublic String getMonthlySalesForItemXml(long ean, Date monthStart, int numberOfMonths) throws EntityDoesNotExistException, XmlValidationException
ean
- ean of item to find its salesmonthStart
- date of some day from the first month of the overviewnumberOfMonths
- number of months of the overviewEntityDoesNotExistException
- if item does not existsXmlValidationException
- on invalid xmlpublic String getDailySalesForCategoryXml(String category, Date dayStart, int numberOfDays) throws EntityDoesNotExistException, XmlValidationException
category
- name of category to find its salesdayStart
- date of the first day of the overviewnumberOfDays
- number of days of the overviewEntityDoesNotExistException
- if category does not existsXmlValidationException
- on invalid xmlpublic String getWeeklySalesForCategoryXml(String category, Date weekStart, int numberOfWeeks) throws EntityDoesNotExistException, XmlValidationException
category
- name of category to find its salesweekStart
- date of some day from the first week of the overviewnumberOfWeeks
- number of weeks of the overviewEntityDoesNotExistException
- if category does not existsXmlValidationException
- on invalid xmlpublic String getMonthlySalesForCategoryXml(String category, Date monthStart, int numberOfMonths) throws EntityDoesNotExistException, XmlValidationException
category
- name of category to find its salesmonthStart
- date of some day from the first month of the overviewnumberOfMonths
- number of months of the overviewEntityDoesNotExistException
- if category does not existsXmlValidationException
- on invalid xmlpublic List<OverviewResultItem> getDailySalesForItem(long ean, Date dayStart, int numberOfDays) throws EntityDoesNotExistException
ean
- ean of item to find its salesdayStart
- date of the first day of the overviewnumberOfDays
- number of days of the overviewEntityDoesNotExistException
- if item does not existspublic List<OverviewResultItem> getWeeklySalesForItem(long ean, Date weekStart, int numberOfWeeks) throws EntityDoesNotExistException
ean
- ean of item to find its salesweekStart
- date of some day from the first week of the overviewnumberOfWeeks
- number of weeks of the overviewEntityDoesNotExistException
- if item does not existspublic List<OverviewResultItem> getMonthlySalesForItem(long ean, Date monthStart, int numberOfMonths) throws EntityDoesNotExistException
ean
- ean of item to find its salesmonthStart
- date of some day from the first month of the overviewnumberOfMonths
- number of months of the overviewEntityDoesNotExistException
- if item does not existspublic List<OverviewResultCategory> getDailySalesForCategory(String category, Date dayStart, int numberOfDays) throws EntityDoesNotExistException
category
- name of category to find its salesdayStart
- date of the first day of the overviewnumberOfDays
- number of days of the overviewEntityDoesNotExistException
- if category does not existspublic List<OverviewResultCategory> getWeeklySalesForCategory(String category, Date weekStart, int numberOfWeeks) throws EntityDoesNotExistException
category
- name of category to find its salesweekStart
- date of some day from the first week of the overviewnumberOfWeeks
- number of weeks of the overviewEntityDoesNotExistException
- if category does not existspublic List<OverviewResultCategory> getMonthlySalesForCategory(String category, Date monthStart, int numberOfMonths) throws EntityDoesNotExistException
category
- name of category to find its salesmonthStart
- date of some day from the first month of the overviewnumberOfMonths
- number of months of the overviewEntityDoesNotExistException
- if category does not existsCopyright © 2017 Pivotal Software, Inc.. All rights reserved.