|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xins.common.service.CallResult
org.xins.common.http.HTTPCallResult
Result returned from an HTTP request.
| Constructor Summary | |
HTTPCallResult(HTTPCallRequest request,
TargetDescriptor succeededTarget,
long duration,
CallExceptionList exceptions,
HTTPCallResultData data)
Constructs a new HTTPCallResult object. |
|
| Method Summary | |
byte[] |
getData()
Returns the result data as a byte array. |
int |
getStatusCode()
Returns the HTTP status code. |
InputStream |
getStream()
Returns the returned data as an InputStream. |
String |
getString()
Returns the returned data as a String. |
String |
getString(String encoding)
Returns the returned data as a String in the specified
encoding. |
| Methods inherited from class org.xins.common.service.CallResult |
getDuration, getExceptions, getRequest, getSucceededTarget |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HTTPCallResult(HTTPCallRequest request,
TargetDescriptor succeededTarget,
long duration,
CallExceptionList exceptions,
HTTPCallResultData data)
throws IllegalArgumentException
HTTPCallResult object.
request - the call request that resulted in this result, cannot be
null.succeededTarget - the target for which the call succeeded, cannot be null.duration - the call duration in milliseconds, must be a non-negative number.exceptions - the list of CallExceptionLists, or null if the
first call attempt succeeded.data - the HTTPCallResultData object returned from the call, cannot
be null.
IllegalArgumentException - if request == null
|| succeededTarget == null
|| data == null
|| duration < 0L.| Method Detail |
public int getStatusCode()
getStatusCode in interface HTTPCallResultDatapublic byte[] getData()
getData in interface HTTPCallResultDatanull.public String getString()
String. The encoding
US-ASCII is assumed.
null.
public String getString(String encoding)
throws UnsupportedEncodingException
String in the specified
encoding.
encoding - the encoding to use in the conversion from bytes to a text string,
not null.
null.
UnsupportedEncodingException - if the specified encoding is not supported.public InputStream getStream()
InputStream. The input
stream is based directly on the underlying byte array.
InputStream that returns the returned data, never
null.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||