public class InventoryClientImpl extends Object implements InventoryClient
| Modifier and Type | Field and Description | 
|---|---|
| private URI | appURIDefines the HTTP URL for the WAR that hosts the JAX-RS resources. | 
| private org.apache.http.client.HttpClient | client | 
| private static org.apache.commons.logging.Log | log | 
| Constructor and Description | 
|---|
| InventoryClientImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected <T> UriBuilder | buildURI(Class<T> resourceClass,
        String method)Helper method that returns a URIBuilder fully initialized to point
 to the URI that will reach the specified method within the inventory
 resource classes. | 
| Product | createProduct(Product product,
             String categoryName)This method uses HTML FORM mechanism to POST a new product in the
 inventory. | 
| boolean | deleteCategory(int id) | 
| boolean | deleteProduct(int id) | 
| Categories | findCategoryByName(String name,
                  int offset,
                  int limit) | 
| Products | findProductsByName(String name,
                  int offset,
                  int limit) | 
| Category | getCategory(int id) | 
| Product | getProduct(int id) | 
| void | setAppURI(URI appURI) | 
| void | setHttpClient(org.apache.http.client.HttpClient client) | 
| Product | updateProduct(Product product) | 
private static final org.apache.commons.logging.Log log
private org.apache.http.client.HttpClient client
private URI appURI
public void setHttpClient(org.apache.http.client.HttpClient client)
public void setAppURI(URI appURI)
protected <T> UriBuilder buildURI(Class<T> resourceClass, String method)
resourceClass - method - public Categories findCategoryByName(String name, int offset, int limit) throws Exception
findCategoryByName in interface InventoryClientExceptionpublic Category getCategory(int id) throws Exception
getCategory in interface InventoryClientExceptionpublic boolean deleteCategory(int id)
                       throws Exception
deleteCategory in interface InventoryClientExceptionpublic Product createProduct(Product product, String categoryName) throws Exception
createProduct in interface InventoryClientExceptionpublic Products findProductsByName(String name, int offset, int limit) throws Exception
findProductsByName in interface InventoryClientExceptionpublic Product getProduct(int id) throws Exception
getProduct in interface InventoryClientExceptionpublic Product updateProduct(Product product) throws Exception
updateProduct in interface InventoryClientExceptionpublic boolean deleteProduct(int id)
                      throws Exception
deleteProduct in interface InventoryClientExceptionCopyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.