|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.servlet.MakeRequestHandler
public class MakeRequestHandler
Handles gadgets.io.makeRequest requests. Unlike ProxyHandler, this may perform operations such as OAuth or signed fetch.
| Field Summary | |
|---|---|
static String |
AUTHZ_PARAM
|
static String |
CONTENT_TYPE_PARAM
|
static String |
DEFAULT_NUM_ENTRIES
|
static String |
GET_FULL_HEADERS_PARAM
|
static String |
GET_SUMMARIES_PARAM
|
static String |
HEADERS_PARAM
|
static String |
METHOD_PARAM
|
static String |
NUM_ENTRIES_PARAM
|
static String |
POST_DATA_PARAM
|
static String |
UNPARSEABLE_CRUFT
|
| Constructor Summary | |
|---|---|
MakeRequestHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry)
|
|
| Method Summary | |
|---|---|
protected HttpRequest |
buildHttpRequest(javax.servlet.http.HttpServletRequest request)
Generate a remote content request based on the parameters sent from the client. |
protected String |
convertResponseToJson(SecurityToken authToken,
javax.servlet.http.HttpServletRequest request,
HttpResponse results)
Format a response as JSON, including additional JSON inserted by chained content fetchers. |
void |
fetch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executes a request, returning the response as JSON to be handled by makeRequest. |
protected static String |
getContainer(javax.servlet.http.HttpServletRequest request)
Extracts the container name from the request. |
protected static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String key,
String defaultValue)
getParameter helper method, returning default value if param not present. |
protected RequestPipeline |
getRequestPipeline()
|
protected void |
setPostData(javax.servlet.http.HttpServletRequest request,
HttpRequest req)
Set http request post data according to servlet request. |
protected static void |
setResponseHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
HttpResponse results)
Sets cache control headers for the response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UNPARSEABLE_CRUFT
public static final String POST_DATA_PARAM
public static final String METHOD_PARAM
public static final String HEADERS_PARAM
public static final String CONTENT_TYPE_PARAM
public static final String NUM_ENTRIES_PARAM
public static final String DEFAULT_NUM_ENTRIES
public static final String GET_SUMMARIES_PARAM
public static final String GET_FULL_HEADERS_PARAM
public static final String AUTHZ_PARAM
| Constructor Detail |
|---|
@Inject
public MakeRequestHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry)
| Method Detail |
|---|
public void fetch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws GadgetException,
IOException
GadgetException
IOException
protected HttpRequest buildHttpRequest(javax.servlet.http.HttpServletRequest request)
throws GadgetException
GadgetException
protected void setPostData(javax.servlet.http.HttpServletRequest request,
HttpRequest req)
throws GadgetException
GadgetException
protected String convertResponseToJson(SecurityToken authToken,
javax.servlet.http.HttpServletRequest request,
HttpResponse results)
throws GadgetException
GadgetExceptionprotected RequestPipeline getRequestPipeline()
protected static String getContainer(javax.servlet.http.HttpServletRequest request)
protected static String getParameter(javax.servlet.http.HttpServletRequest request,
String key,
String defaultValue)
protected static void setResponseHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
HttpResponse results)
throws GadgetException
GadgetException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||