|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcatalog.model.service.impl.CatalogServiceImpl
The implementation of the CatalogService
.
Spring Framework is used to manage this service bean. Since this class is not dependend on Spring API, it can be used outside the Spring IOC container.
It is not used in the sample application.
The CachedCatalogServiceImpl
is used instead.
The purpose of this class is to show you by using Spring Framework,
you can use different implementations of the same interface without code changing and factory.
CatalogService
,
CachedCatalogServiceImpl
Constructor Summary | |
CatalogServiceImpl()
|
Method Summary | |
void |
deleteProduct(Product product)
Delete product. |
java.util.List |
getAllCategories()
Get all categories. |
java.util.List |
getAllProducts()
Get all products. |
Category |
getCategory(java.lang.String id)
Get category by id. |
Product |
getProduct(java.lang.String id)
Get product by product id. |
Product |
saveProduct(Product product)
Save the product. |
void |
setCatalogDao(CatalogDao newCatalogDao)
Set the CatalogDao . |
void |
updateProduct(Product product)
Update product. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CatalogServiceImpl()
Method Detail |
public void setCatalogDao(CatalogDao newCatalogDao)
CatalogDao
.
It can be used by the Spring IOC container.
newCatalogDao
- the CatalogDao to be setpublic Product saveProduct(Product product) throws CatalogException
CatalogService
saveProduct
in interface CatalogService
product
- the product to be saved
CatalogException
CatalogService.saveProduct(Product)
public void updateProduct(Product product) throws CatalogException
CatalogService
updateProduct
in interface CatalogService
product
- the product to be updated
CatalogException
CatalogService.updateProduct(Product)
public void deleteProduct(Product product) throws CatalogException
CatalogService
deleteProduct
in interface CatalogService
product
- the product to be deleted
CatalogException
CatalogService.deleteProduct(Product)
public Product getProduct(java.lang.String id) throws CatalogException
CatalogService
getProduct
in interface CatalogService
id
- the product id
CatalogException
CatalogService.getProduct(String)
public Category getCategory(java.lang.String id) throws CatalogException
CatalogService
getCategory
in interface CatalogService
id
- the category id
CatalogException
CatalogService.getCategory(String)
public java.util.List getAllProducts() throws CatalogException
CatalogService
getAllProducts
in interface CatalogService
CatalogException
CatalogService.getAllProducts()
public java.util.List getAllCategories() throws CatalogException
CatalogService
getAllCategories
in interface CatalogService
CatalogException
CatalogService.getAllCategories()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |