org.apache.mina.proxy.handlers.http

## Class HttpProxyRequest

- java.lang.Object
- - org.apache.mina.proxy.handlers.ProxyRequest
  - - org.apache.mina.proxy.handlers.http.HttpProxyRequest

-     public class HttpProxyRequest
      extends ProxyRequest

  HttpProxyRequest.java - Wrapper class for HTTP requests.
  Since:
    MINA 2.0.0-M3
  Author:
    Apache MINA Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `httpURI` The HTTP URI.
    `String` | `httpVerb` The HTTP verb.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `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.
    `HttpProxyRequest(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 version
    `HttpProxyRequest(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.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkRequiredProperties(String... propNames)` Check if the given property(ies) is(are) set.
    `Map<String,List<String>>` | `getHeaders()` Returns the HTTP headers.
    `String` | `getHost()` Returns the host to which we are connecting.
    `String` | `getHttpURI()` Returns the request HTTP URI.
    `String` | `getHttpVerb()` Returns the HTTP request verb.
    `String` | `getHttpVersion()` Returns the HTTP version.
    `Map<String,String>` | `getProperties()` Returns additional properties for the request.
    `void` | `setHeaders(Map<String,List<String>> headers)` Set the HTTP headers.
    `void` | `setHttpVersion(String httpVersion)` Sets the HTTP version.
    `void` | `setProperties(Map<String,String> properties)` Set additional properties for the request.
    `String` | `toHttpString()` Returns the string representation of the HTTP request .

    - ### Methods inherited from class org.apache.mina.proxy.handlers.ProxyRequest

      `getEndpointAddress`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### httpVerb

          public final String httpVerb

      The HTTP verb.

    - #### httpURI

          public final String httpURI

      The HTTP URI.

  - ### Constructor Detail

    - #### HttpProxyRequest

          public HttpProxyRequest(InetSocketAddress endpointAddress)

      Constructor which creates a HTTP/1.0 CONNECT request to the specified endpoint.
      Parameters:
        `endpointAddress` - the endpoint to connect to

    - #### HttpProxyRequest

          public HttpProxyRequest(InetSocketAddress endpointAddress,
                          String httpVersion)

      Constructor which creates a CONNECT request to the specified endpoint using the provided protocol version.
      Parameters:
        `endpointAddress` - the endpoint to connect to
        `httpVersion` - 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 to
        `httpVersion` - the HTTP protocol version
        `headers` - the additionnal http headers

    - #### HttpProxyRequest

          public HttpProxyRequest(String httpURI)

      Constructor which creates a HTTP/1.0 GET request to the specified http URI.
      Parameters:
        `httpURI` - the target URI

    - #### HttpProxyRequest

          public HttpProxyRequest(String httpURI,
                          String httpVersion)

      Constructor which creates a GET request to the specified http URI using the provided protocol version
      Parameters:
        `httpURI` - the target URI
        `httpVersion` - the HTTP protocol version

    - #### HttpProxyRequest

          public HttpProxyRequest(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.
      Parameters:
        `httpVerb` - the HTTP verb to use
        `httpURI` - the target URI
        `httpVersion` - 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 use
        `httpURI` - the target URI
        `httpVersion` - the HTTP protocol version
        `headers` - the additional http headers

  - ### Method Detail

    - #### getHttpVerb

          public final String getHttpVerb()

      Returns the HTTP request verb.

    - #### getHttpVersion

          public String getHttpVersion()

      Returns the HTTP version.

    - #### setHttpVersion

          public void setHttpVersion(String httpVersion)

      Sets the HTTP version.
      Parameters:
        `httpVersion` - the HTTP protocol version

    - #### getHost

          public final String getHost()

      Returns the host to which we are connecting.

    - #### getHttpURI

          public final String getHttpURI()

      Returns the request HTTP URI.

    - #### getHeaders

          public final Map<String,List<String>> getHeaders()

      Returns the HTTP headers.

    - #### setHeaders

          public final void setHeaders(Map<String,List<String>> headers)

      Set the HTTP headers.

    - #### getProperties

          public Map<String,String> getProperties()

      Returns additional properties for the request.

    - #### setProperties

          public void setProperties(Map<String,String> properties)

      Set additional properties for the request.

    - #### checkRequiredProperties

          public void checkRequiredProperties(String... propNames)
                                       throws ProxyAuthException

      Check if the given property(ies) is(are) set. Otherwise throws a `ProxyAuthException`.
      Throws:
        `ProxyAuthException`

    - #### toHttpString

          public String toHttpString()

      Returns the string representation of the HTTP request .

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.