|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.basho.riak.client.response.HttpResponseDecorator
com.basho.riak.client.response.FetchResponse
WARNING: This class will be REMOVED in the next version.
@Deprecated public class FetchResponse
Response from a HEAD or GET request for an object. Decorates an HttpResponse to interpret fetch and fetchMeta responses from Riak's HTTP interface which returns object metadata in HTTP headers and value in the body.
FetchResponse| Field Summary |
|---|
| Fields inherited from class com.basho.riak.client.response.HttpResponseDecorator |
|---|
impl |
| Constructor Summary | |
|---|---|
FetchResponse(HttpResponse r)
Deprecated. |
|
FetchResponse(HttpResponse r,
RiakClient riak)
Deprecated. On a 2xx response, parse the HTTP response from Riak into a RiakObject. |
|
| Method Summary | |
|---|---|
RiakObject |
getObject()
Deprecated. Returns the first Riak object contained in the response. |
Collection<RiakObject> |
getSiblings()
Deprecated. Returns a collection of the Riak objects contained in the response. |
boolean |
hasObject()
Deprecated. Whether response contained a Riak object |
boolean |
hasSiblings()
Deprecated. Whether response contained a multiple Riak objects |
void |
setObject(RiakObject object)
Deprecated. |
| Methods inherited from class com.basho.riak.client.response.HttpResponseDecorator |
|---|
close, getBody, getBodyAsString, getBucket, getHttpHeaders, getHttpMethod, getHttpResponse, getKey, getStatusCode, getStream, isError, isStreamed, isSuccess |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.basho.riak.client.response.HttpResponse |
|---|
close, getBody, getBodyAsString, getBucket, getHttpHeaders, getHttpMethod, getHttpResponse, getKey, getStatusCode, getStream, isError, isStreamed, isSuccess |
| Constructor Detail |
|---|
public FetchResponse(HttpResponse r,
RiakClient riak)
throws RiakResponseRuntimeException,
RiakIORuntimeException
RiakObject. On a 300 response, parse the multipart/mixed HTTP
body into a collection of sibling RiakObjects.
A streaming response (i.e. r.isStreaming() == true), will have a null
body and non-null stream. The resulting RiakObject(s) will return
null for getValue() and the stream for getValueStream(). Users must
remember to release the return value's underlying stream by calling
close().
Sibling objects are also streamed. The values of the objects are buffered
in memory as the stream is read. Consume and/or close each
RiakObject's stream as the collection is iterated to allow the
buffers to be freed.
RiakResponseRuntimeException - If the server returns a 300 without a proper multipart/mixed
body
RiakIORuntimeException - If an error occurs during communication with the Riak server.
public FetchResponse(HttpResponse r)
throws RiakResponseRuntimeException
RiakResponseRuntimeException| Method Detail |
|---|
public boolean hasObject()
hasObject in interface WithBodyResponsepublic RiakObject getObject()
getObject in interface WithBodyResponsepublic void setObject(RiakObject object)
public boolean hasSiblings()
hasSiblings in interface WithBodyResponsepublic Collection<RiakObject> getSiblings()
getSiblings in interface WithBodyResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||