|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.httpclient.InMemoryCachingHttpClientBuilder
public class InMemoryCachingHttpClientBuilder
An HttpClient builder that supports RFC 2616 caching.
This client will cache information retrieved from the remote server in memory. The backing store does
not perform any resource management (e.g., removing content that has nominally expired) so, special
care must be taken to tune the maxCacheEntries and maxCacheEntrySize appropriately so that the
system's memory is not fully consumed.
| Field Summary | |
|---|---|
private HttpClientBuilder |
clientBuilder
Builder of clients used to fetch data from remote servers. |
private int |
maxCacheEntries
The maximum number of cached responses. |
private int |
maxCacheEntrySize
The maximum response body size, in bytes, that will be eligible for caching. |
| Constructor Summary | |
|---|---|
InMemoryCachingHttpClientBuilder(HttpClientBuilder builder)
Constructor. |
|
| Method Summary | |
|---|---|
HttpClient |
buildClient()
Builds an HTTP client that performs RFC2616 caching. |
int |
getMaxCacheEntries()
Gets the maximum number of cached responses. |
int |
getMaxCacheEntrySize()
Gets the maximum response body size, in bytes, that will be eligible for caching. |
void |
setMaxCacheEntries(int maxEntries)
Sets the maximum number of cached responses. |
void |
setMaxCacheEntrySize(int size)
Sets the maximum response body size, in bytes, that will be eligible for caching. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final HttpClientBuilder clientBuilder
private int maxCacheEntries
private int maxCacheEntrySize
| Constructor Detail |
|---|
public InMemoryCachingHttpClientBuilder(@Nonnull
HttpClientBuilder builder)
builder - builder of clients used to fetch data from remote servers| Method Detail |
|---|
public int getMaxCacheEntries()
public void setMaxCacheEntries(int maxEntries)
maxEntries - maximum number of cached responses, must be greater than zeropublic int getMaxCacheEntrySize()
public void setMaxCacheEntrySize(int size)
size - maximum response body size that will be eligible for caching, must be greater than zeropublic HttpClient buildClient()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||