com.noelios.restlet.ext.httpclient
Class HttpMethodCall

java.lang.Object
  extended by com.noelios.restlet.http.HttpCall
      extended by com.noelios.restlet.http.HttpClientCall
          extended by com.noelios.restlet.ext.httpclient.HttpMethodCall

public class HttpMethodCall
extends HttpClientCall

HTTP client connector call based on Apache HTTP Client's HttpMethod class.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
HttpMethodCall(HttpClientHelper helper, String method, String requestUri, boolean hasEntity)
          Constructor.
 
Method Summary
 HttpMethod getHttpMethod()
          Returns the HTTP method.
 String getReasonPhrase()
          Returns the response reason phrase.
 Series<Parameter> getResponseHeaders()
          Returns the modifiable list of response headers.
 InputStream getResponseStream()
          Returns the response stream if it exists.
 String getServerAddress()
          Returns the response address.
Corresponds to the IP address of the responding server.
 int getStatusCode()
          Returns the response status code.
 Status sendRequest(Request request)
          Sends the request to the client.
 
Methods inherited from class com.noelios.restlet.http.HttpClientCall
getHelper, getLocalAddress, getRequestChannel, getRequestStream, getResponseChannel, getResponseEntity
 
Methods inherited from class com.noelios.restlet.http.HttpCall
formatDate, getClientAddress, getClientPort, getConnectorService, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getRequestHeaders, getRequestUri, getServerPort, getVersion, isConfidential, parseDate, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setLogger, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpMethodCall

public HttpMethodCall(HttpClientHelper helper,
                      String method,
                      String requestUri,
                      boolean hasEntity)
               throws IOException
Constructor.

Parameters:
helper - The parent HTTP client helper.
method - The method name.
requestUri - The request URI.
hasEntity - Indicates if the call will have an entity to send to the server.
Throws:
IOException
Method Detail

getHttpMethod

public HttpMethod getHttpMethod()
Returns the HTTP method.

Returns:
The HTTP method.

sendRequest

public Status sendRequest(Request request)
Sends the request to the client. Commits the request line, headers and optional entity and send them over the network.

Overrides:
sendRequest in class HttpClientCall
Parameters:
request - The high-level request.
Returns:
The result status.

getServerAddress

public String getServerAddress()
Returns the response address.
Corresponds to the IP address of the responding server.

Overrides:
getServerAddress in class HttpCall
Returns:
The response address.

getResponseHeaders

public Series<Parameter> getResponseHeaders()
Returns the modifiable list of response headers.

Overrides:
getResponseHeaders in class HttpCall
Returns:
The modifiable list of response headers.

getStatusCode

public int getStatusCode()
Returns the response status code.

Overrides:
getStatusCode in class HttpCall
Returns:
The response status code.

getReasonPhrase

public String getReasonPhrase()
Returns the response reason phrase.

Overrides:
getReasonPhrase in class HttpCall
Returns:
The response reason phrase.

getResponseStream

public InputStream getResponseStream()
Returns the response stream if it exists.

Overrides:
getResponseStream in class HttpClientCall
Returns:
The response stream if it exists.


Copyright © 2005-2007 Noelios Technologies.