|
|||||||||||
| 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 set
public Product saveProduct(Product product)
throws CatalogException
CatalogService
saveProduct in interface CatalogServiceproduct - the product to be saved
CatalogExceptionCatalogService.saveProduct(Product)
public void updateProduct(Product product)
throws CatalogException
CatalogService
updateProduct in interface CatalogServiceproduct - the product to be updated
CatalogExceptionCatalogService.updateProduct(Product)
public void deleteProduct(Product product)
throws CatalogException
CatalogService
deleteProduct in interface CatalogServiceproduct - the product to be deleted
CatalogExceptionCatalogService.deleteProduct(Product)
public Product getProduct(java.lang.String id)
throws CatalogException
CatalogService
getProduct in interface CatalogServiceid - the product id
CatalogExceptionCatalogService.getProduct(String)
public Category getCategory(java.lang.String id)
throws CatalogException
CatalogService
getCategory in interface CatalogServiceid - the category id
CatalogExceptionCatalogService.getCategory(String)
public java.util.List getAllProducts()
throws CatalogException
CatalogService
getAllProducts in interface CatalogServiceCatalogExceptionCatalogService.getAllProducts()
public java.util.List getAllCategories()
throws CatalogException
CatalogService
getAllCategories in interface CatalogServiceCatalogExceptionCatalogService.getAllCategories()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||