com.googlecode.xremoting.core.http
Class HttpRequest

java.lang.Object
  extended by com.googlecode.xremoting.core.http.HttpRequest
All Implemented Interfaces:
Request

public class HttpRequest
extends Object
implements Request

Request implementation for HTTP using HttpURLConnection.

Author:
Roman Puchkovskiy
See Also:
HttpRequester

Constructor Summary
HttpRequest(HttpURLConnection connection)
           
 
Method Summary
protected  void checkStatusCode(HttpURLConnection connection)
           
 void commitRequest()
          Commits a request.
 InputStream getInputStream()
          Returns InputStream from which user may get response data.
 OutputStream getOutputStream()
          Returns OutputStream to which user may send request data.
 void releaseRequest()
          Releases resources claimed by request (closes connections, etc.).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequest

public HttpRequest(HttpURLConnection connection)
Method Detail

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Description copied from interface: Request
Returns OutputStream to which user may send request data.

Specified by:
getOutputStream in interface Request
Returns:
output stream
Throws:
IOException - if i/o error occurs

commitRequest

public void commitRequest()
                   throws IOException
Description copied from interface: Request
Commits a request. That is, changes request state to the one in which no data may be sent to remote side, and data may be got from remote side.

Specified by:
commitRequest in interface Request
Throws:
IOException - if i/o error occurs

checkStatusCode

protected void checkStatusCode(HttpURLConnection connection)
                        throws IOException
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: Request
Returns InputStream from which user may get response data.

Specified by:
getInputStream in interface Request
Returns:
input stream
Throws:
IOException - if i/o error occurs

releaseRequest

public void releaseRequest()
Description copied from interface: Request
Releases resources claimed by request (closes connections, etc.).

Specified by:
releaseRequest in interface Request


Copyright © 2011. All Rights Reserved.