org.apache.shindig.gadgets.servlet
Class ProxyHandler

java.lang.Object
  extended by org.apache.shindig.gadgets.servlet.ProxyHandler

public class ProxyHandler
extends Object

Handles open proxy requests.


Field Summary
protected  boolean remapInternalServerError
           
 
Constructor Summary
ProxyHandler(RequestPipeline requestPipeline, ResponseRewriterRegistry contentRewriterRegistry, Boolean remapInternalServerError)
           
 
Method Summary
 HttpResponse fetch(ProxyUriManager.ProxyUri proxyUri)
           
 boolean isRecoverable(HttpResponse results)
          Returns true in case the error encountered while rewriting the content is recoverable.
protected  void setResponseContentHeaders(HttpResponseBuilder response, HttpResponse results)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remapInternalServerError

protected final boolean remapInternalServerError
Constructor Detail

ProxyHandler

@Inject
public ProxyHandler(RequestPipeline requestPipeline,
                           ResponseRewriterRegistry contentRewriterRegistry,
                           Boolean remapInternalServerError)
Method Detail

fetch

public HttpResponse fetch(ProxyUriManager.ProxyUri proxyUri)
                   throws IOException,
                          GadgetException
Throws:
IOException
GadgetException

setResponseContentHeaders

protected void setResponseContentHeaders(HttpResponseBuilder response,
                                         HttpResponse results)

isRecoverable

public boolean isRecoverable(HttpResponse results)
Returns true in case the error encountered while rewriting the content is recoverable. The rationale behind it is that errors should be thrown only in case of serious grave errors (defined to be un recoverable). It should always be preferred to handle errors and return the original content at least.

Parameters:
results - The result of rewriting.
Returns:
True if the error is recoverable, false otherwise.


Copyright © 2007-2012. All Rights Reserved.