Class RequestState
java.lang.Object
com.atlassian.plugin.webresource.impl.RequestState
State maintained during single request.
- Since:
- 3.3
-
Constructor Summary
ConstructorsConstructorDescriptionRequestState(Globals globals, UrlBuildingStrategy urlBuildingStrategy, boolean autoIncludeFrontendRuntime) RequestState(RequestState other) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearIncludedAndUpdateExcluded(ResourcePhase resourcePhase, Set<String> excludedResolved) Called after generating urls, to clear current state and remember already included resources.Deprecated.Most UI code is not written to be idempotent, so content for eachRequestableshould only ever be served to the UI once.Deprecated.since 5.0.0.Deprecated.getIncluded(ResourcePhase phaseType) Deprecated.LinkedHashMap<String,com.atlassian.json.marshal.Jsonable> LinkedHashMap<String,com.atlassian.json.marshal.Jsonable> getIncludedData(ResourcePhase resourcePhase) Get all bundles.booleanWhether to automatically include frontend runtime modules (e.g., WRM.require, WRM.data) automatically when the feature is used.booleanvoidsetSyncbatchEnabled(boolean enabled) toString()
-
Constructor Details
-
RequestState
public RequestState(Globals globals, UrlBuildingStrategy urlBuildingStrategy, boolean autoIncludeFrontendRuntime) -
RequestState
-
-
Method Details
-
clearIncludedAndUpdateExcluded
public void clearIncludedAndUpdateExcluded(@Nonnull ResourcePhase resourcePhase, @Nonnull Set<String> excludedResolved) Called after generating urls, to clear current state and remember already included resources. -
deepClone
-
getRequestCache
-
getExcluded
Deprecated.- See Also:
-
getExcludedData
-
getIncluded
Deprecated.- See Also:
-
getIncluded
Deprecated.- See Also:
-
getIncludedData
-
getIncludedData
@Nonnull public LinkedHashMap<String,com.atlassian.json.marshal.Jsonable> getIncludedData(@Nonnull ResourcePhase resourcePhase) -
getExcludedResolved
Most UI code is not written to be idempotent, so content for eachRequestableshould only ever be served to the UI once. Use this list to avoid incurring the full graph traversal cost each time you need the complete list of "already used" content, such as:- Bailing faster in graph traversal if an item in this list is encountered,
- Identifying content sets that would cause something to be served twice,
- Avoiding serving "empty" content sets once accounting for this list,
- and so on.
-
getGlobals
Deprecated.since 5.0.0. There is no replacement. Don't use god objects. -
getRawRequest
-
getSnapshot
Get all bundles.It is another layer of cache over the 'globals.getBundles()' because it is used very heavily, to avoid any performance drawbacks of atomic reference in the 'globals.getBundles()'.
-
isAutoIncludeFrontendRuntimeEnabled
public boolean isAutoIncludeFrontendRuntimeEnabled()Whether to automatically include frontend runtime modules (e.g., WRM.require, WRM.data) automatically when the feature is used.- Returns:
- true if modules should be automatically included; false if they should be manually required.
- Since:
- 5.5.0
-
getUrlStrategy
-
getSuperbatchConfiguration
-
setSyncbatchEnabled
public void setSyncbatchEnabled(boolean enabled) -
isSyncbatchEnabled
public boolean isSyncbatchEnabled() -
toString
-