public static class FileCachingHttpClientBuilder.StorageManagingHttpClient extends CloseableHttpClient implements InitializableComponent, DestructableComponent
CloseableHttpClient and its associated
ManagedHttpCacheStorage, and manages the scheduled maintenance and lifecycle of the latter.| Modifier and Type | Field and Description |
|---|---|
private boolean |
destroyed
Destroyed flag.
|
private CloseableHttpClient |
httpClient
The wrapped HttpClient instance.
|
private boolean |
initialized
Initialized flag.
|
private Logger |
log
Logger.
|
private TimerTask |
maintenanceTask
The scheduled storage maintenance task.
|
private long |
maintenanceTaskInterval
Interval of the scheduled maintenance task.
|
private ManagedHttpCacheStorage |
storage
The cache storage instance to manage.
|
private Timer |
timer
Scheduled task timer.
|
| Constructor and Description |
|---|
FileCachingHttpClientBuilder.StorageManagingHttpClient(CloseableHttpClient wrappedClient,
ManagedHttpCacheStorage managedStorage,
long taskInterval)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
destroy()
Destroys the component.
|
protected CloseableHttpResponse |
doExecute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context) |
ClientConnectionManager |
getConnectionManager()
Deprecated.
|
org.apache.http.params.HttpParams |
getParams()
Deprecated.
|
void |
initialize()
Initializes the component.
|
boolean |
isDestroyed()
Gets whether this component has been destroyed.
|
boolean |
isInitialized()
Gets whether this component is initialized.
|
private Logger log
private CloseableHttpClient httpClient
private ManagedHttpCacheStorage storage
private long maintenanceTaskInterval
private boolean initialized
private boolean destroyed
private Timer timer
private TimerTask maintenanceTask
public FileCachingHttpClientBuilder.StorageManagingHttpClient(@Nonnull CloseableHttpClient wrappedClient, @Nonnull ManagedHttpCacheStorage managedStorage, long taskInterval)
wrappedClient - the wrapped HttpClient instancemanagedStorage - the managed cache storage instancetaskInterval - the interval at which storage maintenance should runprotected CloseableHttpResponse doExecute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws IOException, ClientProtocolException
doExecute in class CloseableHttpClientIOExceptionClientProtocolException@Deprecated public org.apache.http.params.HttpParams getParams()
getParams in interface HttpClient@Deprecated public ClientConnectionManager getConnectionManager()
getConnectionManager in interface HttpClientpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean isInitialized()
isInitialized in interface InitializableComponentpublic boolean isDestroyed()
isDestroyed in interface DestructableComponentpublic void initialize()
throws ComponentInitializationException
initialize in interface InitializableComponentComponentInitializationException - thrown if there is a problem initializing the componentpublic void destroy()
destroy in interface DestructableComponentCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.