|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.basho.riak.client.http.response.RiakResponseRuntimeException
public class RiakResponseRuntimeException
Thrown when the Riak server returns a malformed response. The HTTP response is returned in the exception.
| Constructor Summary | |
|---|---|
RiakResponseRuntimeException(HttpResponse response)
|
|
RiakResponseRuntimeException(HttpResponse response,
String message)
|
|
RiakResponseRuntimeException(HttpResponse response,
String message,
Throwable cause)
|
|
RiakResponseRuntimeException(HttpResponse response,
Throwable cause)
|
|
| Method Summary | |
|---|---|
void |
close()
Releases the underlying the HTTP connection when the response is streamed |
byte[] |
getBody()
The HTTP response body or null if isStreamed() |
String |
getBodyAsString()
|
String |
getBucket()
The target object's bucket |
Map<String,String> |
getHttpHeaders()
The HTTP response headers. |
org.apache.http.client.methods.HttpRequestBase |
getHttpMethod()
The actual HttpRequestBase used to make the HTTP request. |
org.apache.http.HttpResponse |
getHttpResponse()
|
String |
getKey()
The target object's key or null if bucket is target |
int |
getStatusCode()
Resulting status code from the HTTP request. |
InputStream |
getStream()
The HTTP response body as an input stream if isStreamed(); null otherwise |
boolean |
isError()
Whether the HTTP request returned a 4xx or 5xx response |
boolean |
isStreamed()
Whether the response body is available as an input stream |
boolean |
isSuccess()
Whether the HTTP response is considered a success. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RiakResponseRuntimeException(HttpResponse response)
public RiakResponseRuntimeException(HttpResponse response,
String message,
Throwable cause)
public RiakResponseRuntimeException(HttpResponse response,
String message)
public RiakResponseRuntimeException(HttpResponse response,
Throwable cause)
| Method Detail |
|---|
public byte[] getBody()
HttpResponse
getBody in interface HttpResponsepublic String getBodyAsString()
getBodyAsString in interface HttpResponsepublic InputStream getStream()
HttpResponse
getStream in interface HttpResponsepublic boolean isStreamed()
HttpResponse
isStreamed in interface HttpResponsepublic String getBucket()
HttpResponse
getBucket in interface HttpResponsepublic Map<String,String> getHttpHeaders()
HttpResponse
getHttpHeaders in interface HttpResponsepublic org.apache.http.client.methods.HttpRequestBase getHttpMethod()
HttpResponseHttpRequestBase used to make the HTTP request. Most of
the data here can be retrieved more simply using methods in this class.
The method will already be in a finished state.
getHttpMethod in interface HttpResponsepublic String getKey()
HttpResponse
getKey in interface HttpResponsepublic int getStatusCode()
HttpResponse
getStatusCode in interface HttpResponsepublic boolean isError()
HttpResponse
isError in interface HttpResponsepublic boolean isSuccess()
HttpResponse
isSuccess in interface HttpResponsepublic void close()
HttpResponse
close in interface HttpResponsepublic org.apache.http.HttpResponse getHttpResponse()
getHttpResponse in interface HttpResponseHttpResponse returned by http client
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||