com.basho.riak.client.response
Class HttpResponseDecorator

java.lang.Object
  extended by com.basho.riak.client.response.HttpResponseDecorator
All Implemented Interfaces:
HttpResponse
Direct Known Subclasses:
BucketResponse, FetchResponse, MapReduceResponse, StoreResponse, WalkResponse

Deprecated. with the addition of a protocol buffers client in 0.14 all the existing REST client code should be in client.http.* this class has therefore been moved. Please use com.basho.riak.client.http.response.HttpResponseDecorator instead.

WARNING: This class will be REMOVED in the next version.

@Deprecated
public class HttpResponseDecorator
extends Object
implements HttpResponse

A default decorator implementation for HttpResponse

See Also:
HttpResponseDecorator

Field Summary
protected  HttpResponse impl
          Deprecated.  
 
Constructor Summary
HttpResponseDecorator(HttpResponse r)
          Deprecated.  
 
Method Summary
 void close()
          Deprecated. Releases the underlying the HTTP connection when the response is streamed
 byte[] getBody()
          Deprecated. The HTTP response body or null if isStreamed()
 String getBodyAsString()
          Deprecated.  
 String getBucket()
          Deprecated. The target object's bucket
 Map<String,String> getHttpHeaders()
          Deprecated. The HTTP response headers.
 org.apache.http.client.methods.HttpRequestBase getHttpMethod()
          Deprecated. The actual HttpMethod used to make the HTTP request.
 org.apache.http.HttpResponse getHttpResponse()
          Deprecated.  
 String getKey()
          Deprecated. The target object's key or null if bucket is target
 int getStatusCode()
          Deprecated. Resulting status code from the HTTP request.
 InputStream getStream()
          Deprecated. The HTTP response body as an input stream if isStreamed(); null otherwise
 boolean isError()
          Deprecated. Whether the HTTP request returned a 4xx or 5xx response
 boolean isStreamed()
          Deprecated. Whether the response body is available as an input stream
 boolean isSuccess()
          Deprecated. Whether the HTTP response is considered a success.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

impl

protected HttpResponse impl
Deprecated. 
Constructor Detail

HttpResponseDecorator

public HttpResponseDecorator(HttpResponse r)
Deprecated. 
Method Detail

getBucket

public String getBucket()
Deprecated. 
Description copied from interface: HttpResponse
The target object's bucket

Specified by:
getBucket in interface HttpResponse

getKey

public String getKey()
Deprecated. 
Description copied from interface: HttpResponse
The target object's key or null if bucket is target

Specified by:
getKey in interface HttpResponse

getBody

public byte[] getBody()
Deprecated. 
Description copied from interface: HttpResponse
The HTTP response body or null if isStreamed()

Specified by:
getBody in interface HttpResponse

getBodyAsString

public String getBodyAsString()
Deprecated. 
Specified by:
getBodyAsString in interface HttpResponse

getStream

public InputStream getStream()
Deprecated. 
Description copied from interface: HttpResponse
The HTTP response body as an input stream if isStreamed(); null otherwise

Specified by:
getStream in interface HttpResponse

isStreamed

public boolean isStreamed()
Deprecated. 
Description copied from interface: HttpResponse
Whether the response body is available as an input stream

Specified by:
isStreamed in interface HttpResponse

getHttpHeaders

public Map<String,String> getHttpHeaders()
Deprecated. 
Description copied from interface: HttpResponse
The HTTP response headers.

Specified by:
getHttpHeaders in interface HttpResponse

getHttpMethod

public org.apache.http.client.methods.HttpRequestBase getHttpMethod()
Deprecated. 
Description copied from interface: HttpResponse
The actual HttpMethod used to make the HTTP request. Most of the data here can be retrieved more simply using methods in this class. Also, note that the connection will already be closed, so calling getHttpMethod().getResponseBodyAsStream() will return null.

Specified by:
getHttpMethod in interface HttpResponse

getStatusCode

public int getStatusCode()
Deprecated. 
Description copied from interface: HttpResponse
Resulting status code from the HTTP request.

Specified by:
getStatusCode in interface HttpResponse

isError

public boolean isError()
Deprecated. 
Description copied from interface: HttpResponse
Whether the HTTP request returned a 4xx or 5xx response

Specified by:
isError in interface HttpResponse

isSuccess

public boolean isSuccess()
Deprecated. 
Description copied from interface: HttpResponse
Whether the HTTP response is considered a success. Generally this translates to a 2xx for any request, a 304 for GET and HEAD requests, or 404 for DELETE requests.

Specified by:
isSuccess in interface HttpResponse

close

public void close()
Deprecated. 
Description copied from interface: HttpResponse
Releases the underlying the HTTP connection when the response is streamed

Specified by:
close in interface HttpResponse

getHttpResponse

public org.apache.http.HttpResponse getHttpResponse()
Deprecated. 
Specified by:
getHttpResponse in interface HttpResponse
Returns:


Copyright © 2012. All Rights Reserved.