com.parthparekh.ws
Class ProductWebServiceImpl

java.lang.Object
  extended by com.parthparekh.ws.ProductWebServiceImpl
All Implemented Interfaces:
ProductWebService

@Service(value="productWebService")
public class ProductWebServiceImpl
extends java.lang.Object
implements ProductWebService

Product web service implementation


Field Summary
private static org.slf4j.Logger logger
           
private  ProductService productService
           
 
Constructor Summary
ProductWebServiceImpl()
           
 
Method Summary
 Product createProduct(Product product)
          creates a product with name, description and price
 java.util.List<Product> getAll()
          retrieves all the available products
 Product getProduct(java.lang.String id)
          retrieve product information from id
 Product updateProduct(java.lang.String id, Product product)
          update product information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.slf4j.Logger logger

productService

@Autowired
@Qualifier(value="cache")
private ProductService productService
Constructor Detail

ProductWebServiceImpl

public ProductWebServiceImpl()
Method Detail

createProduct

public Product createProduct(Product product)
Description copied from interface: ProductWebService
creates a product with name, description and price

Specified by:
createProduct in interface ProductWebService
Parameters:
product - - Product JSON containing name, description, status and price
Returns:
returns the product that is persisted

getProduct

public Product getProduct(java.lang.String id)
Description copied from interface: ProductWebService
retrieve product information from id

Specified by:
getProduct in interface ProductWebService
Parameters:
id - - product identifier
Returns:
returns the product from db

getAll

public java.util.List<Product> getAll()
Description copied from interface: ProductWebService
retrieves all the available products

Specified by:
getAll in interface ProductWebService
Returns:
returns all the products from db

updateProduct

public Product updateProduct(java.lang.String id,
                             Product product)
Description copied from interface: ProductWebService
update product information

Specified by:
updateProduct in interface ProductWebService
Parameters:
id - - product identifier for the existing product to update
product - - Product JSON containing updated name, description, status and/or price
Returns:
returns the product that was updated