|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.webservice.client.util.HttpConnection
public class HttpConnection
The HttpConnection is class wrapping implementation details of http connection and the implementation can change easily.
| Constructor Summary | |
|---|---|
HttpConnection(Request request)
|
|
| Method Summary | |
|---|---|
protected void |
checkResponse(java.lang.String url)
Called to check the response and generate an appropriate exception (on failure). |
void |
close()
Closes connection. |
void |
connect()
Opens connection. |
java.io.InputStream |
getResponseBodyAsStream()
|
java.lang.String |
getResponseBodyAsString()
|
int |
getResponseCode()
|
java.lang.String |
getResponseHeader(java.lang.String name)
|
java.io.InputStream |
getResponseStream()
|
protected void |
handleErrorResponse()
Handles an error response received while executing a service request. |
boolean |
isOpened()
|
void |
setTimeout(int timeout)
Sets timeout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpConnection(Request request)
request - client request| Method Detail |
|---|
public java.io.InputStream getResponseStream()
public void connect()
public java.lang.String getResponseHeader(java.lang.String name)
name - header name
public void close()
public void setTimeout(int timeout)
timeout - timeout in millisecondspublic int getResponseCode()
public boolean isOpened()
protected void checkResponse(java.lang.String url)
url - a URL to quote in any error messages
ServiceException - when an error happens
protected void handleErrorResponse()
throws java.io.IOException
ServiceException or one of its subclasses, depending on
the failure conditions.
ServiceException - exception describing the failure.
java.io.IOException - error reading the error response from the
service.public java.lang.String getResponseBodyAsString()
public java.io.InputStream getResponseBodyAsStream()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||