Class GadgetRequestContext

java.lang.Object
com.atlassian.gadgets.GadgetRequestContext

public final class GadgetRequestContext extends Object
Holds information associated with a gadget request that the system will need to use. GadgetRequestContext objects should be created using the GadgetRequestContext.Builder class. By doing a static import of the GadgetRequestContext.Builder.gadgetRequestContext() method, you can create a GadgetRequestContext as follows:
  GadgetRequestContext gadgetRequestContext = gadgetRequestContext().user(new GadgetRequestContext.User("bob", "bob)).build();
 
  • Field Details

  • Method Details

    • getLocale

      public Locale getLocale()
      Returns the locale used for this request.
      Returns:
      the Locale used for this request
    • getIgnoreCache

      public boolean getIgnoreCache()
      Returns the cache setting used for this request.
      Returns:
      the RequestCacheSetting used for this request
    • getViewer

      public String getViewer()
      Returns the viewer (the current user) for this request.
      Returns:
      the username of this request viewer
      See Also:
    • getView

      public View getView()
      Returns the dashboard view.
      Returns:
      dashboard view
    • isDebuggingEnabled

      public boolean isDebuggingEnabled()
      Returns true if the gadget should be rendered with debugging enabled, false otherwise. When this returns true, the JavaScript for the features used by the gadget will be served in non-minimized, making it easier to debug.
      Returns:
      true if the gadget should be rendered with debugging enabled, false otherwise
    • getUser

      public io.atlassian.fugue.Option<GadgetRequestContext.User> getUser()
      Returns the current user or none if user is anonymous.
      Returns:
      current user