public class MockConnectionManager extends Object implements org.apache.http.conn.HttpClientConnectionManager
Constructor and Description |
---|
MockConnectionManager() |
Modifier and Type | Method and Description |
---|---|
void |
closeExpiredConnections() |
void |
closeIdleConnections(long idletime,
TimeUnit tunit) |
void |
connect(org.apache.http.HttpClientConnection conn,
org.apache.http.conn.routing.HttpRoute route,
int connectTimeout,
org.apache.http.protocol.HttpContext context) |
org.apache.http.HttpResponse |
execute(org.apache.http.HttpRequest request) |
org.apache.http.HttpRequest |
getSentRequest() |
boolean |
hasOpenConnections() |
void |
releaseConnection(org.apache.http.HttpClientConnection conn,
Object newState,
long validDuration,
TimeUnit timeUnit) |
org.apache.http.conn.ConnectionRequest |
requestConnection(org.apache.http.conn.routing.HttpRoute route,
Object state) |
void |
routeComplete(org.apache.http.HttpClientConnection conn,
org.apache.http.conn.routing.HttpRoute route,
org.apache.http.protocol.HttpContext context) |
void |
setResponse(org.apache.http.HttpResponse response)
Set the HttpResponse that will always be returned when calling the backend.
|
void |
setResponseHandler(IResponseHandler responseHandler)
Set a custom response handler.
|
void |
shutdown() |
void |
upgrade(org.apache.http.HttpClientConnection conn,
org.apache.http.conn.routing.HttpRoute route,
org.apache.http.protocol.HttpContext context) |
public org.apache.http.conn.ConnectionRequest requestConnection(org.apache.http.conn.routing.HttpRoute route, Object state)
requestConnection
in interface org.apache.http.conn.HttpClientConnectionManager
public void releaseConnection(org.apache.http.HttpClientConnection conn, Object newState, long validDuration, TimeUnit timeUnit)
releaseConnection
in interface org.apache.http.conn.HttpClientConnectionManager
public void closeIdleConnections(long idletime, TimeUnit tunit)
closeIdleConnections
in interface org.apache.http.conn.HttpClientConnectionManager
public void closeExpiredConnections()
closeExpiredConnections
in interface org.apache.http.conn.HttpClientConnectionManager
public void shutdown()
shutdown
in interface org.apache.http.conn.HttpClientConnectionManager
public org.apache.http.HttpRequest getSentRequest()
public void setResponse(org.apache.http.HttpResponse response)
response
- public void setResponseHandler(IResponseHandler responseHandler)
responseHandler
- public org.apache.http.HttpResponse execute(org.apache.http.HttpRequest request)
public final boolean hasOpenConnections()
public void connect(org.apache.http.HttpClientConnection conn, org.apache.http.conn.routing.HttpRoute route, int connectTimeout, org.apache.http.protocol.HttpContext context)
connect
in interface org.apache.http.conn.HttpClientConnectionManager
public void upgrade(org.apache.http.HttpClientConnection conn, org.apache.http.conn.routing.HttpRoute route, org.apache.http.protocol.HttpContext context)
upgrade
in interface org.apache.http.conn.HttpClientConnectionManager
public void routeComplete(org.apache.http.HttpClientConnection conn, org.apache.http.conn.routing.HttpRoute route, org.apache.http.protocol.HttpContext context)
routeComplete
in interface org.apache.http.conn.HttpClientConnectionManager
Copyright © 2008–2018. All rights reserved.