public class CustomerClientImpl extends Object implements CustomerClient
| Modifier and Type | Field and Description |
|---|---|
private URI |
appURI
Defines 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 |
|---|
CustomerClientImpl() |
| Modifier and Type | Method and Description |
|---|---|
Customer |
addCustomer(Customer customer) |
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.
|
boolean |
deleteCustomer(int id) |
Customers |
findCustomersByName(String firstName,
String lastName,
int offset,
int limit) |
Customer |
getCustomer(int id) |
void |
setAppURI(URI appURI) |
void |
setHttpClient(org.apache.http.client.HttpClient client) |
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 Customer addCustomer(Customer customer) throws Exception
addCustomer in interface CustomerClientExceptionpublic Customers findCustomersByName(String firstName, String lastName, int offset, int limit) throws Exception
findCustomersByName in interface CustomerClientExceptionpublic Customer getCustomer(int id) throws Exception
getCustomer in interface CustomerClientExceptionpublic boolean deleteCustomer(int id)
throws Exception
deleteCustomer in interface CustomerClientExceptionCopyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.