Package com.atlassian.gadgets
Class GadgetRequestContext
java.lang.Object
com.atlassian.gadgets.GadgetRequestContext
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder that facilitates construction ofGadgetRequestContextobjects.static final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the cache setting used for this request.Returns the locale used for this request.io.atlassian.fugue.Option<GadgetRequestContext.User>getUser()Returns the current user or none if user is anonymous.getView()Returns the dashboard view.Returns the viewer (the current user) for this request.booleanReturnstrueif the gadget should be rendered with debugging enabled,falseotherwise.
-
Field Details
-
NO_CURRENT_REQUEST
-
-
Method Details
-
getLocale
Returns the locale used for this request.- Returns:
- the
Localeused for this request
-
getIgnoreCache
public boolean getIgnoreCache()Returns the cache setting used for this request.- Returns:
- the
RequestCacheSettingused for this request
-
getViewer
Returns the viewer (the current user) for this request.- Returns:
- the username of this request viewer
- See Also:
-
getView
Returns the dashboard view.- Returns:
- dashboard view
-
isDebuggingEnabled
public boolean isDebuggingEnabled()Returnstrueif the gadget should be rendered with debugging enabled,falseotherwise. When this returnstrue, the JavaScript for the features used by the gadget will be served in non-minimized, making it easier to debug.- Returns:
trueif the gadget should be rendered with debugging enabled,falseotherwise
-
getUser
Returns the current user or none if user is anonymous.- Returns:
- current user
-