public class GatewayHttpProxy extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private int |
connectTimeOut |
private String |
contentType |
private Exception |
exception |
private Map<String,String> |
headers |
protected static HostnameVerifier |
hnv |
private boolean |
instanceFollowRedirects |
private static com.jfinal.log.Log |
LOG |
private int |
readTimeOut |
private int |
retries |
protected static X509TrustManager |
trustAnyTrustManager |
private boolean |
useCaches |
| 构造器和说明 |
|---|
GatewayHttpProxy() |
GatewayHttpProxy(JbootGatewayConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
GatewayHttpProxy |
addHeader(String key,
String value) |
GatewayHttpProxy |
addHeaders(Map<String,String> headers) |
protected void |
configConnection(HttpURLConnection conn,
javax.servlet.http.HttpServletRequest req) |
protected void |
configResponse(javax.servlet.http.HttpServletResponse resp,
HttpURLConnection conn) |
protected void |
copyConnStreamToResponse(HttpURLConnection conn,
javax.servlet.http.HttpServletResponse resp) |
protected void |
copyRequestStreamToConnection(javax.servlet.http.HttpServletRequest req,
HttpURLConnection conn) |
protected void |
doSendRequest(String url,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected HttpURLConnection |
getConnection(String urlString) |
int |
getConnectTimeOut() |
String |
getContentType() |
Exception |
getException() |
Map<String,String> |
getHeaders() |
protected HttpURLConnection |
getHttpConnection(String urlString) |
protected HttpsURLConnection |
getHttpsConnection(String urlString) |
protected InputStream |
getInputStream(HttpURLConnection conn) |
int |
getReadTimeOut() |
int |
getRetries() |
boolean |
isInstanceFollowRedirects() |
boolean |
isUseCaches() |
protected void |
quetlyClose(Closeable... closeables) |
void |
sendRequest(String url,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
setConnectTimeOut(int connectTimeOut) |
void |
setContentType(String contentType) |
void |
setException(Exception exception) |
void |
setHeaders(Map<String,String> headers) |
void |
setInstanceFollowRedirects(boolean instanceFollowRedirects) |
void |
setReadTimeOut(int readTimeOut) |
void |
setRetries(int retries) |
void |
setUseCaches(boolean useCaches) |
private static final com.jfinal.log.Log LOG
private int readTimeOut
private int connectTimeOut
private int retries
private String contentType
private boolean instanceFollowRedirects
private boolean useCaches
protected static X509TrustManager trustAnyTrustManager
protected static HostnameVerifier hnv
public GatewayHttpProxy()
public GatewayHttpProxy(JbootGatewayConfig config)
public void sendRequest(String url, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
protected void doSendRequest(String url, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws Exception
Exceptionprotected void copyRequestStreamToConnection(javax.servlet.http.HttpServletRequest req, HttpURLConnection conn) throws IOException
IOExceptionprotected void copyConnStreamToResponse(HttpURLConnection conn, javax.servlet.http.HttpServletResponse resp) throws IOException
IOExceptionprotected void quetlyClose(Closeable... closeables)
protected void configResponse(javax.servlet.http.HttpServletResponse resp, HttpURLConnection conn) throws IOException
IOExceptionprotected InputStream getInputStream(HttpURLConnection conn) throws IOException
IOExceptionprotected void configConnection(HttpURLConnection conn, javax.servlet.http.HttpServletRequest req) throws ProtocolException
protected HttpURLConnection getConnection(String urlString)
protected HttpURLConnection getHttpConnection(String urlString) throws Exception
Exceptionprotected HttpsURLConnection getHttpsConnection(String urlString) throws Exception
Exceptionpublic Exception getException()
public void setException(Exception exception)
public int getReadTimeOut()
public void setReadTimeOut(int readTimeOut)
public int getConnectTimeOut()
public void setConnectTimeOut(int connectTimeOut)
public int getRetries()
public void setRetries(int retries)
public String getContentType()
public void setContentType(String contentType)
public boolean isInstanceFollowRedirects()
public void setInstanceFollowRedirects(boolean instanceFollowRedirects)
public boolean isUseCaches()
public void setUseCaches(boolean useCaches)
public Map<String,String> getHeaders()
public void setHeaders(Map<String,String> headers)
public GatewayHttpProxy addHeader(String key, String value)
public GatewayHttpProxy addHeaders(Map<String,String> headers)
Copyright © 2024. All rights reserved.