com.github.dreamhead.moco.handler
Class AbstractProxyResponseHandler

java.lang.Object
  extended by com.github.dreamhead.moco.handler.AbstractResponseHandler
      extended by com.github.dreamhead.moco.handler.AbstractProxyResponseHandler
All Implemented Interfaces:
ConfigApplier<ResponseHandler>, ResponseHandler
Direct Known Subclasses:
ProxyBatchResponseHandler, ProxyResponseHandler

public abstract class AbstractProxyResponseHandler
extends AbstractResponseHandler


Field Summary
protected  Failover failover
           
 
Constructor Summary
AbstractProxyResponseHandler(Failover failover)
           
 
Method Summary
protected  org.apache.http.client.methods.HttpRequestBase prepareRemoteRequest(io.netty.handler.codec.http.FullHttpRequest request, java.net.URL url)
           
protected  com.google.common.base.Optional<java.net.URL> remoteUrl(io.netty.handler.codec.http.FullHttpRequest request)
           
protected abstract  com.google.common.base.Optional<java.lang.String> remoteUrl(java.lang.String uri)
           
protected  void setupResponse(HttpRequest request, io.netty.handler.codec.http.FullHttpResponse response, org.apache.http.HttpResponse remoteResponse)
           
 void writeToResponse(SessionContext context)
           
 
Methods inherited from class com.github.dreamhead.moco.handler.AbstractResponseHandler
apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failover

protected final Failover failover
Constructor Detail

AbstractProxyResponseHandler

public AbstractProxyResponseHandler(Failover failover)
Method Detail

remoteUrl

protected abstract com.google.common.base.Optional<java.lang.String> remoteUrl(java.lang.String uri)

prepareRemoteRequest

protected org.apache.http.client.methods.HttpRequestBase prepareRemoteRequest(io.netty.handler.codec.http.FullHttpRequest request,
                                                                              java.net.URL url)

setupResponse

protected void setupResponse(HttpRequest request,
                             io.netty.handler.codec.http.FullHttpResponse response,
                             org.apache.http.HttpResponse remoteResponse)
                      throws java.io.IOException
Throws:
java.io.IOException

writeToResponse

public void writeToResponse(SessionContext context)

remoteUrl

protected com.google.common.base.Optional<java.net.URL> remoteUrl(io.netty.handler.codec.http.FullHttpRequest request)