net.spy.memcached.protocol.couch
Class HttpOperationImpl

java.lang.Object
  extended by net.spy.memcached.protocol.couch.HttpOperationImpl
All Implemented Interfaces:
HttpOperation
Direct Known Subclasses:
DocsOperationImpl, NoDocsOperationImpl, ReducedOperationImpl, ViewOperationImpl, ViewsOperationImpl

public abstract class HttpOperationImpl
extends Object
implements HttpOperation


Field Summary
protected  OperationCallback callback
           
protected  OperationException exception
           
 
Constructor Summary
HttpOperationImpl(org.apache.http.HttpRequest r, OperationCallback cb)
           
 
Method Summary
 void cancel()
           
 OperationCallback getCallback()
           
protected  String getEntityString(org.apache.http.HttpResponse response)
           
 OperationException getException()
           
 org.apache.http.HttpRequest getRequest()
           
abstract  void handleResponse(org.apache.http.HttpResponse response)
           
 boolean hasErrored()
           
 boolean isCancelled()
           
 boolean isTimedOut()
           
protected  OperationStatus parseViewForStatus(String json, int errorcode)
           
 void timeOut()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callback

protected final OperationCallback callback

exception

protected OperationException exception
Constructor Detail

HttpOperationImpl

public HttpOperationImpl(org.apache.http.HttpRequest r,
                         OperationCallback cb)
Method Detail

getRequest

public org.apache.http.HttpRequest getRequest()
Specified by:
getRequest in interface HttpOperation

getCallback

public OperationCallback getCallback()
Specified by:
getCallback in interface HttpOperation

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface HttpOperation

hasErrored

public boolean hasErrored()
Specified by:
hasErrored in interface HttpOperation

isTimedOut

public boolean isTimedOut()
Specified by:
isTimedOut in interface HttpOperation

cancel

public void cancel()
Specified by:
cancel in interface HttpOperation

timeOut

public void timeOut()
Specified by:
timeOut in interface HttpOperation

getException

public OperationException getException()
Specified by:
getException in interface HttpOperation

handleResponse

public abstract void handleResponse(org.apache.http.HttpResponse response)
Specified by:
handleResponse in interface HttpOperation

getEntityString

protected String getEntityString(org.apache.http.HttpResponse response)

parseViewForStatus

protected OperationStatus parseViewForStatus(String json,
                                             int errorcode)
                                      throws org.apache.http.ParseException
Throws:
org.apache.http.ParseException