public class HttpClientManager extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
HttpClientManager.ServerKey
Server lookup key.
|
Modifier and Type | Field and Description |
---|---|
private SoftCache |
rolodex |
private static Executor |
systemThreadPool |
private TimedMap |
unsentAcks |
Constructor and Description |
---|
HttpClientManager(long ackTimeout)
Creates new HttpClientManager which expires unsent acknowledgments after
the specified timeout.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addUnsentAcks(String host,
int port,
String[] cookies)
Adds to list of unsent acknowledgments for server at given host/port.
|
(package private) void |
cacheServerInfo(ServerInfo info)
Caches HTTP server information, overwriting any previously registered
information for server if timestamp is more recent.
|
void |
clearServerInfo()
Forgets all cached information about contacted HTTP servers.
|
(package private) void |
clearUnsentAcks(String host,
int port,
String[] cookies)
Removes cookies from list of unsent acknowledgments for server at given
host/port.
|
(package private) ServerInfo |
getServerInfo(String host,
int port)
Returns cached information about specified HTTP server, or ServerInfo
struct with default values if no entry found.
|
(package private) String[] |
getUnsentAcks(String host,
int port)
Returns list of unsent acknowledgments for server at given host/port.
|
private static final Executor systemThreadPool
private final SoftCache rolodex
private final TimedMap unsentAcks
public HttpClientManager(long ackTimeout)
public void clearServerInfo()
void addUnsentAcks(String host, int port, String[] cookies)
void clearUnsentAcks(String host, int port, String[] cookies)
String[] getUnsentAcks(String host, int port)
ServerInfo getServerInfo(String host, int port)
void cacheServerInfo(ServerInfo info)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.