public class MakeRequestHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
MakeRequestHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
@Inject public MakeRequestHandler(RequestPipeline requestPipeline, ResponseRewriterRegistry contentRewriterRegistry)
public void fetch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws GadgetException,
IOException
GadgetExceptionIOExceptionprotected HttpRequest buildHttpRequest(javax.servlet.http.HttpServletRequest request) throws GadgetException
GadgetExceptionprotected void setPostData(javax.servlet.http.HttpServletRequest request,
HttpRequest req)
throws GadgetException
GadgetExceptionprotected 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
GadgetExceptionCopyright © 2007-2012. All Rights Reserved.