public class SimpleHTTPClient extends AbstractLifeCycle
| 限定符和类型 | 类和说明 |
|---|---|
class |
SimpleHTTPClient.RequestBuilder
The HTTP request builder that helps you to create a new HTTP request.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
log |
start| 构造器和说明 |
|---|
SimpleHTTPClient() |
SimpleHTTPClient(SimpleHTTPClientConfiguration http2Configuration) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearHealthCheck(String name)
Clear the health check task.
|
protected ClientHTTPHandler |
createClientHTTPHandler(SimpleHTTPClient.RequestBuilder reqBuilder,
com.codahale.metrics.Timer.Context resTimerCtx,
PooledObject<HTTPClientConnection> pooledConn) |
protected AsynchronousPool<HTTPClientConnection> |
createConnectionPool(SimpleHTTPClient.RequestBuilder request) |
SimpleHTTPClient.RequestBuilder |
delete(String url)
Create a RequestBuilder with DELETE method and URL.
|
protected void |
destroy() |
SimpleHTTPClient.RequestBuilder |
get(String url)
Create a RequestBuilder with GET method and URL.
|
int |
getConnectionPoolSize(String url)
Get the HTTP connection pool size.
|
int |
getConnectionPoolSize(String host,
int port)
Get the HTTP connection pool size.
|
int |
getConnectionPoolSize(URL url)
Get the HTTP connection pool size.
|
protected AsynchronousPool<HTTPClientConnection> |
getPool(SimpleHTTPClient.RequestBuilder request) |
SimpleHTTPClient.RequestBuilder |
head(String url)
Create a RequestBuilder with HEAD method and URL.
|
protected void |
init() |
SimpleHTTPClient.RequestBuilder |
post(String url)
Create a RequestBuilder with POST method and URL.
|
SimpleHTTPClient.RequestBuilder |
put(String url)
Create a RequestBuilder with PUT method and URL.
|
void |
registerHealthCheck(Task task)
Register an health check task.
|
void |
removeConnectionPool(String url)
Remove the HTTP connection pool.
|
void |
removeConnectionPool(String host,
int port)
Remove the HTTP connection pool.
|
void |
removeConnectionPool(URL url)
Remove the HTTP connection pool.
|
SimpleHTTPClient.RequestBuilder |
request(HttpMethod method,
String url)
Create a RequestBuilder with HTTP method and URL.
|
SimpleHTTPClient.RequestBuilder |
request(String method,
String url)
Create a RequestBuilder with HTTP method and URL.
|
SimpleHTTPClient.RequestBuilder |
request(String method,
URL url)
Create a RequestBuilder with HTTP method and URL.
|
protected void |
send(SimpleHTTPClient.RequestBuilder reqBuilder) |
protected void |
send(SimpleHTTPClient.RequestBuilder reqBuilder,
com.codahale.metrics.Timer.Context resTimerCtx,
HTTPClientConnection connection,
ClientHTTPHandler handler) |
isStarted, isStopped, start, stoppublic SimpleHTTPClient()
public SimpleHTTPClient(SimpleHTTPClientConfiguration http2Configuration)
public void removeConnectionPool(String url)
url - The host URL.public void removeConnectionPool(URL url)
url - The host URL.public void removeConnectionPool(String host, int port)
host - The host URL.port - The target port.public int getConnectionPoolSize(String host, int port)
host - The host name.port - The target port.public int getConnectionPoolSize(String url)
url - The host URL.public int getConnectionPoolSize(URL url)
url - The host URL.public SimpleHTTPClient.RequestBuilder get(String url)
url - The request URL.public SimpleHTTPClient.RequestBuilder post(String url)
url - The request URL.public SimpleHTTPClient.RequestBuilder head(String url)
url - The request URL.public SimpleHTTPClient.RequestBuilder put(String url)
url - The request URL.public SimpleHTTPClient.RequestBuilder delete(String url)
url - The request URL.public SimpleHTTPClient.RequestBuilder request(HttpMethod method, String url)
method - HTTP method.url - The request URL.public SimpleHTTPClient.RequestBuilder request(String method, String url)
method - HTTP method.url - The request URL.public SimpleHTTPClient.RequestBuilder request(String method, URL url)
method - HTTP method.url - The request URL.public void registerHealthCheck(Task task)
task - The health check task.public void clearHealthCheck(String name)
name - The task name.protected void send(SimpleHTTPClient.RequestBuilder reqBuilder)
protected void send(SimpleHTTPClient.RequestBuilder reqBuilder, com.codahale.metrics.Timer.Context resTimerCtx, HTTPClientConnection connection, ClientHTTPHandler handler)
protected ClientHTTPHandler createClientHTTPHandler(SimpleHTTPClient.RequestBuilder reqBuilder, com.codahale.metrics.Timer.Context resTimerCtx, PooledObject<HTTPClientConnection> pooledConn)
protected AsynchronousPool<HTTPClientConnection> getPool(SimpleHTTPClient.RequestBuilder request)
protected AsynchronousPool<HTTPClientConnection> createConnectionPool(SimpleHTTPClient.RequestBuilder request)
protected void init()
init 在类中 AbstractLifeCycleprotected void destroy()
destroy 在类中 AbstractLifeCycleCopyright © 2017. All rights reserved.