org.apache.shindig.gadgets.servlet
Class HttpGadgetContext

java.lang.Object
  extended by org.apache.shindig.gadgets.GadgetContext
      extended by org.apache.shindig.gadgets.servlet.HttpGadgetContext

public class HttpGadgetContext
extends GadgetContext

Implements GadgetContext using an HttpServletRequest


Field Summary
static String USERPREF_PARAM_PREFIX
           
 
Constructor Summary
HttpGadgetContext(javax.servlet.http.HttpServletRequest request)
           
 
Method Summary
 String getContainer()
           
 boolean getDebug()
           
 String getHost()
           
 boolean getIgnoreCache()
           
 Locale getLocale()
           
 int getModuleId()
           
 String getParameter(String name)
           
 RenderingContext getRenderingContext()
           
 SecurityToken getToken()
           
 Uri getUrl()
           
 String getUserAgent()
           
 String getUserIp()
           
 UserPrefs getUserPrefs()
           
 String getView()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USERPREF_PARAM_PREFIX

public static final String USERPREF_PARAM_PREFIX
See Also:
Constant Field Values
Constructor Detail

HttpGadgetContext

public HttpGadgetContext(javax.servlet.http.HttpServletRequest request)
Method Detail

getParameter

public String getParameter(String name)
Overrides:
getParameter in class GadgetContext
Parameters:
name - The parameter to get data for.
Returns:
The parameter set under the given name, or null.

getContainer

public String getContainer()
Overrides:
getContainer in class GadgetContext
Returns:
The container of the current request.

getHost

public String getHost()
Overrides:
getHost in class GadgetContext
Returns:
The host for which the current request is being made.

getUserIp

public String getUserIp()
Overrides:
getUserIp in class GadgetContext
Returns:
The IP Address for the current user.

getDebug

public boolean getDebug()
Overrides:
getDebug in class GadgetContext
Returns:
Whether or not to show debug output.

getIgnoreCache

public boolean getIgnoreCache()
Overrides:
getIgnoreCache in class GadgetContext
Returns:
Whether or not to bypass caching behavior for the current request.

getLocale

public Locale getLocale()
Overrides:
getLocale in class GadgetContext
Returns:
The locale for this request.

getModuleId

public int getModuleId()
Overrides:
getModuleId in class GadgetContext
Returns:
The module id for this request.

getRenderingContext

public RenderingContext getRenderingContext()
Overrides:
getRenderingContext in class GadgetContext
Returns:
The rendering context for this request.

getToken

public SecurityToken getToken()
Overrides:
getToken in class GadgetContext
Returns:
The token associated with this request

getUrl

public Uri getUrl()
Overrides:
getUrl in class GadgetContext
Returns:
The url for this gadget.

getUserPrefs

public UserPrefs getUserPrefs()
Overrides:
getUserPrefs in class GadgetContext
Returns:
The user prefs for the current request.

getView

public String getView()
Overrides:
getView in class GadgetContext
Returns:
Name of view to show

getUserAgent

public String getUserAgent()
Overrides:
getUserAgent in class GadgetContext
Returns:
The user agent string, or null if not present.


Copyright © 2007-2012. All Rights Reserved.