public class HttpJsonHomeClient extends java.lang.Object implements JsonHomeClient
| Constructor and Description |
|---|
HttpJsonHomeClient()
Constructs a default HttpJsonHomeClient build on top of a CachingHttpClient with in-memory storage.
|
HttpJsonHomeClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.impl.client.cache.CacheConfig cacheConfig)
Constructs a HttpJsonHomeClient using a HttpClient and a CacheConfig.
|
HttpJsonHomeClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.client.cache.HttpCacheStorage storage,
org.apache.http.impl.client.cache.CacheConfig cacheConfig)
Constructs a caching HttpJsonHomeClient using a HttpClient, HttpCacheStorage and a CacheConfig.
|
| Modifier and Type | Method and Description |
|---|---|
de.otto.jsonhome.model.JsonHome |
get(java.net.URI uri)
Gets the JsonHome document associated to the specified URI.
|
void |
shutdown()
Shutdown the client and dispose all resources.
|
de.otto.jsonhome.model.JsonHome |
updateAndGet(java.net.URI uri)
Updates the (possibly cached) JsonHome instance identified by the URI and returns the updated instance.
|
public HttpJsonHomeClient()
public HttpJsonHomeClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.impl.client.cache.CacheConfig cacheConfig)
httpClient - non-caching HttpClient used to get resources.cacheConfig - configuration of the HttpCacheStoragepublic HttpJsonHomeClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.client.cache.HttpCacheStorage storage,
org.apache.http.impl.client.cache.CacheConfig cacheConfig)
httpClient - non-caching HttpClient used to get resources.storage - the HttpCacheStorage used to cache HTTP responses.cacheConfig - configuration of the HttpCacheStoragepublic de.otto.jsonhome.model.JsonHome updateAndGet(java.net.URI uri)
updateAndGet in interface JsonHomeClienturi - the URI uniquely identifying the JsonHome instance.public de.otto.jsonhome.model.JsonHome get(java.net.URI uri)
get in interface JsonHomeClienturi - the URI of the JsonHome document.public void shutdown()
JsonHomeClientshutdown in interface JsonHomeClient