public class MakeRequestHandler extends Object implements ContainerConfig.ConfigObserver
| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS_PARAM |
static String |
AUTHZ_PARAM |
static String |
CONTENT_TYPE_PARAM |
static String |
CORE_IO |
static String |
DEFAULT_NUM_ENTRIES |
static String |
GADGETS_FEATURES |
static String |
GET_FULL_HEADERS_PARAM |
static String |
GET_SUMMARIES_PARAM |
static String |
HEADERS_PARAM |
static String |
IFRAME_RESPONSE_PREFIX |
static String |
IFRAME_RESPONSE_SUFFIX |
static int |
MAX_POST_SIZE_DEFAULT |
static String |
MAX_POST_SIZE_KEY |
static String |
METHOD_PARAM |
static String |
MULTI_PART_FORM_POST |
static String |
MULTI_PART_FORM_POST_IFRAME |
static String |
NUM_ENTRIES_PARAM |
static String |
POST_DATA_PARAM |
static String |
UNPARSEABLE_CRUFT |
| Constructor and Description |
|---|
MakeRequestHandler(ContainerConfig config,
RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry,
com.google.inject.Provider<FeedProcessor> feedProcessorProvider,
GadgetAdminStore gadgetAdminStore,
Processor processor,
LockedDomainService lockedDomainService) |
| 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.
|
void |
containersChanged(ContainerConfig config,
Collection<String> changed,
Collection<String> removed) |
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(String container,
javax.servlet.http.HttpServletRequest request,
HttpRequest req)
Set http request post data according to servlet request.
|
protected 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 ALIAS_PARAM
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
public static final String MAX_POST_SIZE_KEY
public static final String MULTI_PART_FORM_POST
public static final String MULTI_PART_FORM_POST_IFRAME
public static final String GADGETS_FEATURES
public static final String CORE_IO
public static final String UNPARSEABLE_CRUFT
public static final int MAX_POST_SIZE_DEFAULT
public static final String IFRAME_RESPONSE_PREFIX
public static final String IFRAME_RESPONSE_SUFFIX
@Inject public MakeRequestHandler(ContainerConfig config, RequestPipeline requestPipeline, ResponseRewriterRegistry contentRewriterRegistry, com.google.inject.Provider<FeedProcessor> feedProcessorProvider, GadgetAdminStore gadgetAdminStore, Processor processor, LockedDomainService lockedDomainService)
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(String container, 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 void setResponseHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
HttpResponse results)
throws GadgetException
GadgetExceptionpublic void containersChanged(ContainerConfig config, Collection<String> changed, Collection<String> removed)
containersChanged in interface ContainerConfig.ConfigObserverCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.