final class ProductServiceEP6Rest extends java.lang.Object implements ProductService
Modifier and Type | Field and Description |
---|---|
private CategoryService |
categoryService |
private Converter<java.util.List<Link>,java.util.List<Link>> |
converter |
private InvocationBuilderFactory |
invocationBuilderFactory |
private static javax.ws.rs.core.UriBuilder |
RESOURCE_ID_URI_BUILDER |
private static java.lang.String |
RESOURCE_PATH |
private Searcher |
searcher |
private static java.lang.String |
STARTPAGE_RESOURCE_PATH |
private static javax.ws.rs.core.UriBuilder |
SUBRESOURCE_URI_BUILDER |
Constructor and Description |
---|
ProductServiceEP6Rest(InvocationBuilderFactory invocationBuilderFactory,
Converter<java.util.List<Link>,java.util.List<Link>> converter,
CategoryService categoryService,
Searcher searcher) |
Modifier and Type | Method and Description |
---|---|
private static void |
cleanupHtml(PageEP6<ProductApi> products,
java.lang.String baseUri) |
private static void |
cleanupHtml(ProductApi products,
java.lang.String baseUri) |
<T extends ResourceSupport> |
convertLinks(T obj) |
private void |
convertProductLinks(ProductApi result) |
private void |
convertProductsLinks(PageEP6<ProductApi> products) |
void |
delete(ShopRequestContext shopRequestContext,
GUID productId) |
private <T> T |
doRestCall(javax.ws.rs.client.Invocation invocation,
java.lang.Class<T> class1) |
private static <T> T |
doRestCall(javax.ws.rs.client.Invocation invocation,
javax.ws.rs.core.GenericType<T> class1) |
ProductApi |
get(ShopRequestContext shopReqCtx,
GUID productGuid)
Provides a product in a given shop request context
|
PageEP6<ProductApi> |
getAll(ShopRequestContext reqCtx,
ProductApi.SortAttribute attribute,
SortDirection direction,
java.lang.String query,
GUID categoryId)
Provides all products in a given shop request context
|
PageEP6<ProductApi> |
getByIds(ShopRequestContext shopReqCtx,
java.util.List<GUID> guids) |
CustomAttributes |
getCustomAttributes(ShopRequestContext shopReqCtx,
GUID productId) |
SimpleVariation |
getLowestPriceVariation(ShopRequestContext shopReqCtx,
GUID productId) |
ResourceSupport |
getProductCategories(ShopRequestContext shopReqCtx,
GUID productGuid) |
private static java.util.List<GUID> |
getResultGuids(SearchResponse response) |
PageEP6<ProductApi> |
getRootCategoryProducts(ShopRequestContext shopReqCtx) |
StockLevel |
getStockLevel(ShopRequestContext shopReqCtx,
GUID productId) |
private <T> T |
invokeGetObject(ShopRequestContext shopReqCtx,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object[]> params,
java.lang.Class<T> returnType) |
private <T> T |
invokeGetObject(ShopRequestContext shopReqCtx,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object[]> params,
javax.ws.rs.core.GenericType<T> returnType) |
private ProductApi |
invokeGetProduct(ShopRequestContext shopReqCtx,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object[]> params) |
private PageEP6<ProductApi> |
invokeGetProducts(ShopRequestContext shopReqCtx,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object[]> params) |
private PageEP6<ProductApi> |
postProcessProducts(PageEP6<ProductApi> products,
ShopRequestContext shopReqCtx) |
private ProductApi |
postProcessProducts(ProductApi product,
ShopRequestContext shopReqCtx) |
StockLevel |
updateStockLevel(ShopRequestContext shopReqCtx,
GUID productId,
StockLevelUpdate stockLevelUpdate) |
private static final java.lang.String RESOURCE_PATH
private static final javax.ws.rs.core.UriBuilder SUBRESOURCE_URI_BUILDER
private static final javax.ws.rs.core.UriBuilder RESOURCE_ID_URI_BUILDER
private static final java.lang.String STARTPAGE_RESOURCE_PATH
private final InvocationBuilderFactory invocationBuilderFactory
private final CategoryService categoryService
private final Searcher searcher
@Inject public ProductServiceEP6Rest(InvocationBuilderFactory invocationBuilderFactory, Converter<java.util.List<Link>,java.util.List<Link>> converter, CategoryService categoryService, Searcher searcher)
public ProductApi get(ShopRequestContext shopReqCtx, GUID productGuid)
ProductService
get
in interface ProductService
public void delete(ShopRequestContext shopRequestContext, GUID productId)
delete
in interface ProductService
public PageEP6<ProductApi> getByIds(ShopRequestContext shopReqCtx, java.util.List<GUID> guids)
getByIds
in interface ProductService
public PageEP6<ProductApi> getRootCategoryProducts(ShopRequestContext shopReqCtx)
getRootCategoryProducts
in interface ProductService
public PageEP6<ProductApi> getAll(ShopRequestContext reqCtx, ProductApi.SortAttribute attribute, SortDirection direction, java.lang.String query, GUID categoryId)
ProductService
getAll
in interface ProductService
private static java.util.List<GUID> getResultGuids(SearchResponse response)
public CustomAttributes getCustomAttributes(ShopRequestContext shopReqCtx, GUID productId)
getCustomAttributes
in interface ProductService
public SimpleVariation getLowestPriceVariation(ShopRequestContext shopReqCtx, GUID productId)
getLowestPriceVariation
in interface ProductService
public ResourceSupport getProductCategories(ShopRequestContext shopReqCtx, GUID productGuid)
getProductCategories
in interface ProductService
private ProductApi invokeGetProduct(ShopRequestContext shopReqCtx, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object[]> params)
private PageEP6<ProductApi> invokeGetProducts(ShopRequestContext shopReqCtx, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object[]> params)
private <T> T invokeGetObject(ShopRequestContext shopReqCtx, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object[]> params, javax.ws.rs.core.GenericType<T> returnType)
private <T> T invokeGetObject(ShopRequestContext shopReqCtx, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object[]> params, java.lang.Class<T> returnType)
private ProductApi postProcessProducts(ProductApi product, ShopRequestContext shopReqCtx)
private PageEP6<ProductApi> postProcessProducts(PageEP6<ProductApi> products, ShopRequestContext shopReqCtx)
private static <T> T doRestCall(javax.ws.rs.client.Invocation invocation, javax.ws.rs.core.GenericType<T> class1)
private <T> T doRestCall(javax.ws.rs.client.Invocation invocation, java.lang.Class<T> class1)
private void convertProductsLinks(PageEP6<ProductApi> products)
public <T extends ResourceSupport> void convertLinks(T obj)
private void convertProductLinks(ProductApi result)
private static void cleanupHtml(ProductApi products, java.lang.String baseUri)
private static void cleanupHtml(PageEP6<ProductApi> products, java.lang.String baseUri)
public StockLevel getStockLevel(ShopRequestContext shopReqCtx, GUID productId)
getStockLevel
in interface ProductService
public StockLevel updateStockLevel(ShopRequestContext shopReqCtx, GUID productId, StockLevelUpdate stockLevelUpdate)
updateStockLevel
in interface ProductService