Class HttpProxyRequest
java.lang.Object
org.apache.mina.proxy.handlers.ProxyRequest
org.apache.mina.proxy.handlers.http.HttpProxyRequest
HttpProxyRequest.java - Wrapper class for HTTP requests.
- Since:
- MINA 2.0.0-M3
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe request headers.private StringThe target hostname.private final StringThe HTTP URI.private final StringThe HTTP verb.private StringThe HTTP protocol version.private static final org.slf4j.LoggerThe additionnal properties supplied to use with the proxy for authentication for example. -
Constructor Summary
ConstructorsConstructorDescriptionHttpProxyRequest(String httpURI) Constructor which creates a HTTP/1.0 GET request to the specified http URI.HttpProxyRequest(String httpURI, String httpVersion) Constructor which creates a GET request to the specified http URI using the provided protocol versionHttpProxyRequest(String httpVerb, String httpURI, String httpVersion) Constructor which creates a request using the provided HTTP verb targeted at the specified http URI using the provided protocol version.HttpProxyRequest(String httpVerb, String httpURI, String httpVersion, Map<String, List<String>> headers) Constructor which creates a request using the provided HTTP verb targeted at the specified http URI using the provided protocol version and setting the requested headers.HttpProxyRequest(InetSocketAddress endpointAddress) Constructor which creates a HTTP/1.0 CONNECT request to the specified endpoint.HttpProxyRequest(InetSocketAddress endpointAddress, String httpVersion) Constructor which creates a CONNECT request to the specified endpoint using the provided protocol version.HttpProxyRequest(InetSocketAddress endpointAddress, String httpVersion, Map<String, List<String>> headers) Constructor which creates a CONNECT request to the specified endpoint using the provided protocol version and setting the requested headers. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckRequiredProperties(String... propNames) Check if the given property(ies) is(are) set.final StringgetHost()final Stringfinal Stringfinal voidsetHeaders(Map<String, List<String>> headers) Set the HTTP headers.voidsetHttpVersion(String httpVersion) Sets the HTTP version.voidsetProperties(Map<String, String> properties) Set additional properties for the request.Methods inherited from class ProxyRequest
getEndpointAddress
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
httpVerb
The HTTP verb. -
httpURI
The HTTP URI. -
httpVersion
The HTTP protocol version. -
host
The target hostname. -
headers
-
properties
-
-
Constructor Details
-
HttpProxyRequest
Constructor which creates a HTTP/1.0 CONNECT request to the specified endpoint.- Parameters:
endpointAddress- the endpoint to connect to
-
HttpProxyRequest
Constructor which creates a CONNECT request to the specified endpoint using the provided protocol version.- Parameters:
endpointAddress- the endpoint to connect tohttpVersion- the HTTP protocol version
-
HttpProxyRequest
public HttpProxyRequest(InetSocketAddress endpointAddress, String httpVersion, Map<String, List<String>> headers) Constructor which creates a CONNECT request to the specified endpoint using the provided protocol version and setting the requested headers.- Parameters:
endpointAddress- the endpoint to connect tohttpVersion- the HTTP protocol versionheaders- the additionnal http headers
-
HttpProxyRequest
Constructor which creates a HTTP/1.0 GET request to the specified http URI.- Parameters:
httpURI- the target URI
-
HttpProxyRequest
-
HttpProxyRequest
Constructor which creates a request using the provided HTTP verb targeted at the specified http URI using the provided protocol version.- Parameters:
httpVerb- the HTTP verb to usehttpURI- the target URIhttpVersion- the HTTP protocol version
-
HttpProxyRequest
public HttpProxyRequest(String httpVerb, String httpURI, String httpVersion, Map<String, List<String>> headers) Constructor which creates a request using the provided HTTP verb targeted at the specified http URI using the provided protocol version and setting the requested headers.- Parameters:
httpVerb- the HTTP verb to usehttpURI- the target URIhttpVersion- the HTTP protocol versionheaders- the additional http headers
-
-
Method Details
-
getHttpVerb
- Returns:
- the HTTP request verb.
-
getHttpVersion
- Returns:
- the HTTP version.
-
setHttpVersion
Sets the HTTP version.- Parameters:
httpVersion- the HTTP protocol version
-
getHost
- Returns:
- the host to which we are connecting.
-
getHttpURI
- Returns:
- the request HTTP URI.
-
getHeaders
-
setHeaders
-
getProperties
-
setProperties
-
checkRequiredProperties
Check if the given property(ies) is(are) set. Otherwise throws aProxyAuthException.- Parameters:
propNames- The list of property name to check- Throws:
ProxyAuthException- If we get an error during the proxy authentication
-
toHttpString
- Returns:
- the string representation of the HTTP request .
-