public class Config extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Config.IntermediaryContextData |
| Constructor and Description |
|---|
Config(ResourceBatchingConfiguration batchingConfiguration,
WebResourceIntegration integration,
WebResourceUrlProvider urlProvider,
com.atlassian.plugin.servlet.ServletContextFactory servletContextFactory,
TransformerCache transformerCache,
ResourceCompiler resourceCompiler) |
| Modifier and Type | Method and Description |
|---|---|
protected Resource |
buildResource(Bundle bundle,
com.atlassian.plugin.elements.ResourceLocation resourceLocation)
Helper to hide bunch of integration code and simplify resource creation.
|
String |
computeGlobalStateHash()
Represents product state considering everything that contributes to content of resources.
|
protected void |
ensureNoLegacyStuff(Snapshot snapshot)
Analyzes current state of the plugin system and return web resources.
|
String |
getBaseUrl() |
String |
getBaseUrl(boolean isAbsolute) |
ResourceBatchingConfiguration |
getBatchingConfiguration()
Deprecated.
|
List<String> |
getBeforeAllResources() |
boolean |
getBigPipeDeadlineDisabled() |
protected boolean |
getBooleanFromDarkFeatureManagerThenSystemProperty(String name)
Will do its best to return a result from DarkFeatureManager, but will fallback to System properties
|
File |
getCacheDirectory() |
CdnResourceUrlTransformer |
getCdnResourceUrlTransformer()
Returns a URL transformer to allow clients to map resource URLs as in
getResourceCdnPrefix(String). |
ResourceContentAnnotator |
getContentAnnotator(String type) |
int |
getContentCacheSize() |
String |
getContentType(String path) |
String |
getCtCdnBaseUrl()
Returns the CDN base URL to prefix all pre-baked resources mapped with
WebResourceMapper. |
TimeSpan |
getDefaultBigPipeDeadline() |
static DependencyGraph<Requestable> |
getDependencyGraph() |
int |
getIncrementalCacheSize() |
WebResourceIntegration |
getIntegration()
Deprecated.
since 3.3.2
|
Resource |
getModuleResource(String completeKey,
String name)
Get not declared Resource.
|
Resource |
getPluginResource(String pluginKey,
String name)
Get Resource for Plugin.
|
static String |
getPluginVersionOrInstallTime(com.atlassian.plugin.Plugin plugin,
boolean usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins)
For SNAPSHOT plugins will return install time instead of the version.
|
String |
getResourceCdnPrefix(String url) |
ResourceCompiler |
getResourceCompiler() |
ResourceFactory |
getResourceFactory() |
protected static List<com.atlassian.plugin.elements.ResourceLocation> |
getResourceLocations(WebResourceModuleDescriptor webResourceModuleDescriptor,
boolean compiledResourcesEnabled) |
LinkedHashMap<String,Resource> |
getResourcesWithoutCache(Bundle bundle)
Queries the plugin system and return list of Resources for Web Resource.
|
String |
getResourceUrlPrefix(String hash,
String bundleHash,
boolean isAbsolute) |
StaticTransformers |
getStaticTransformers() |
TransformerCache |
getTransformerCache()
Deprecated.
since 3.3.2
|
int |
getUrlCacheSize() |
LinkedHashMap<String,com.atlassian.json.marshal.Jsonable> |
getWebResourceData(String key)
Get data resources for web resource.
|
WebResourceMapper |
getWebResourceMapper()
Returns the current instance of
WebResourceMapper or no-op when
WebResourceIntegration.isCtCdnMappingEnabled() is false. |
Snapshot |
getWebResourcesWithoutCache()
Analyzes current state of the plugin system and return web resources.
|
boolean |
ignorePrebakeWarnings()
This property indicates if resources tainted only with
PrebakeWarnings should be considered for prebaking. |
boolean |
isBatchContentTrackingEnabled() |
static boolean |
isBundleHashValidationEnabled()
Determines if bundle hash validation for batch resources should be disabled.
|
boolean |
isCdnEnabled() |
boolean |
isContentCacheEnabled() |
boolean |
isContextBatchingEnabled() |
static boolean |
isContextKey(String key)
If the key is context or web resource key.
|
boolean |
isCSSPrebakingEnabled()
Returns true if CSS prebaking is enabled, false otherwise
|
boolean |
isDeferJsAttributeEnabled()
Deprecated.
since 5.0.0, use ResourcePriority.DEFER instead
|
boolean |
isGlobalMinificationEnabled()
Determines if global minification of resources is enabled based on a System Property.
|
boolean |
isIncrementalCacheEnabled()
If incremental cache enabled.
|
boolean |
isJavaScriptTryCatchWrappingEnabled() |
boolean |
isMinificationEnabled()
If minification enabled.
|
static boolean |
isNotWebResourceKey(String completeKey) |
boolean |
isPerformanceTrackingEnabled() |
boolean |
isPreBakeEnabled()
Determines if pre-baker REST API is enabled based on a System Property..
|
boolean |
isSourceMapEnabled() |
boolean |
isSourceMapEnabledFor(String typeOrContentType) |
static boolean |
isStaticContextOrderEnabled()
Determines if batch URLs contexts' are sorted to ensure that the same URL is generated no matter what order the
contexts are required in.
|
boolean |
isSuperbatchCreated() |
boolean |
isSuperBatchingEnabled() |
boolean |
isSyncBatchingEnabled() |
boolean |
isSyncContextCreated() |
boolean |
isUrlCachingEnabled() |
boolean |
isUrlGenerationCacheEnabled()
Deprecated.
since 5.0.0. Use
isUrlCachingEnabled instead. |
boolean |
isWebResourceBatchingEnabled() |
static boolean |
isWebResourceKey(String completeKey)
If `completeKey` is Web Resource key or Plugin key.
|
boolean |
optimiseSourceMapsForDevelopment() |
int |
partialHashCode()
Hash code representing the state of config.
|
void |
reloadWebResourceMapper()
Forces the creation of a new instance of
WebResourceMapper, resetting the current reference to it. |
boolean |
resplitMergedContextBatchesForThisRequest() |
void |
runResourceCompilation(Snapshot snapshot) |
void |
setContentTypeResolver(com.atlassian.plugin.servlet.ContentTypeResolver contentTypeResolver)
Needed because `contentTypeResolver` isn't available at the time Config is created and set up a bit later.
|
void |
setStaticTransformers(StaticTransformers staticTransformers) |
static String |
virtualContextKeyToWebResourceKey(String virtualContextKey)
Convert virtual context key to web resource key.
|
public static final String IEONLY_PARAM_NAME
public static final String SOURCE_PARAM_NAME
public static final String BATCH_PARAM_NAME
public static final String MEDIA_PARAM_NAME
public static final String CONTENT_TYPE_PARAM_NAME
public static final String CACHE_PARAM_NAME
public static final String ALLOW_PUBLIC_USE_PARAM_NAME
public static final String CONDITIONAL_COMMENT_PARAM_NAME
public static final String ASYNC_SCRIPT_PARAM_NAME
public static final String DEFER_SCRIPT_PARAM_NAME
public static final String INITIAL_RENDERED_SCRIPT_PARAM_NAME
public static final String WRM_KEY_PARAM_NAME
public static final String WRM_BATCH_TYPE_PARAM_NAME
public static final String DOWNLOAD_PARAM_VALUE
public static final String JS_TYPE
public static final String JS_CONTENT_TYPE
public static final String CSS_TYPE
public static final String CSS_CONTENT_TYPE
public static final String LESS_TYPE
public static final String SOY_TYPE
public static final String CSS_EXTENSION
public static final String LESS_EXTENSION
public static final String JS_EXTENSION
public static final String SOY_EXTENSION
public static final String[] BATCH_TYPES
public static final int GET_URL_MAX_LENGTH
public static final String[] HTTP_PARAM_NAMES
public static final String CONTEXT_PREFIX
public static final String SUPER_BATCH_CONTEXT_KEY
public static final String SUPERBATCH_KEY
public static final String SYNCBATCH_CONTEXT_KEY
public static final String SYNCBATCH_KEY
public static final String INCREMENTAL_CACHE_SIZE
public static final String ENABLE_BUNDLE_HASH_VALIDATION
public static final String DISABLE_PERFORMANCE_TRACKING
public Config(ResourceBatchingConfiguration batchingConfiguration, WebResourceIntegration integration, WebResourceUrlProvider urlProvider, com.atlassian.plugin.servlet.ServletContextFactory servletContextFactory, TransformerCache transformerCache, ResourceCompiler resourceCompiler)
public static boolean isContextKey(String key)
public static String virtualContextKeyToWebResourceKey(String virtualContextKey)
protected static List<com.atlassian.plugin.elements.ResourceLocation> getResourceLocations(WebResourceModuleDescriptor webResourceModuleDescriptor, boolean compiledResourcesEnabled)
public static boolean isWebResourceKey(@Nonnull String completeKey)
public static boolean isStaticContextOrderEnabled()
public static String getPluginVersionOrInstallTime(com.atlassian.plugin.Plugin plugin, boolean usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins)
public void setContentTypeResolver(com.atlassian.plugin.servlet.ContentTypeResolver contentTypeResolver)
public boolean isContentCacheEnabled()
public int getContentCacheSize()
public int getIncrementalCacheSize()
public File getCacheDirectory()
@Nonnull public static DependencyGraph<Requestable> getDependencyGraph()
public boolean isSourceMapEnabledFor(String typeOrContentType)
typeOrContentType - type or content type.public boolean isSourceMapEnabled()
public boolean isCdnEnabled()
public String getBaseUrl()
public String getBaseUrl(boolean isAbsolute)
isAbsolute - if url should be absolute or relative.public String getResourceUrlPrefix(String hash, String bundleHash, boolean isAbsolute)
public String getResourceCdnPrefix(String url)
public ResourceContentAnnotator getContentAnnotator(String type)
public StaticTransformers getStaticTransformers()
public void setStaticTransformers(StaticTransformers staticTransformers)
protected void ensureNoLegacyStuff(Snapshot snapshot)
public boolean isSyncContextCreated()
RuntimeException - if called before getWebResourcesWithoutCache().public boolean isSuperbatchCreated()
RuntimeException - if called before getWebResourcesWithoutCache().public Snapshot getWebResourcesWithoutCache()
public LinkedHashMap<String,Resource> getResourcesWithoutCache(Bundle bundle)
public LinkedHashMap<String,com.atlassian.json.marshal.Jsonable> getWebResourceData(String key)
public boolean isMinificationEnabled()
protected Resource buildResource(Bundle bundle, com.atlassian.plugin.elements.ResourceLocation resourceLocation)
public Resource getModuleResource(String completeKey, String name)
public Resource getPluginResource(String pluginKey, String name)
public boolean optimiseSourceMapsForDevelopment()
public boolean isSyncBatchingEnabled()
public boolean isSuperBatchingEnabled()
public boolean isBatchContentTrackingEnabled()
public boolean isContextBatchingEnabled()
public boolean isWebResourceBatchingEnabled()
public boolean isIncrementalCacheEnabled()
public int partialHashCode()
Strictly speaking this hash should include the full state of config, but it would be too slow, so instead we check only for some of its properties.
@Deprecated public WebResourceIntegration getIntegration()
@Deprecated public TransformerCache getTransformerCache()
public int getUrlCacheSize()
@Deprecated public ResourceBatchingConfiguration getBatchingConfiguration()
@Deprecated public boolean isDeferJsAttributeEnabled()
public TimeSpan getDefaultBigPipeDeadline()
public boolean getBigPipeDeadlineDisabled()
public String computeGlobalStateHash()
public CdnResourceUrlTransformer getCdnResourceUrlTransformer()
getResourceCdnPrefix(String).public boolean isPreBakeEnabled()
public static boolean isBundleHashValidationEnabled()
public boolean isGlobalMinificationEnabled()
public String getCtCdnBaseUrl()
WebResourceMapper.public ResourceCompiler getResourceCompiler()
public void runResourceCompilation(Snapshot snapshot)
public boolean resplitMergedContextBatchesForThisRequest()
public WebResourceMapper getWebResourceMapper()
WebResourceMapper or no-op when
WebResourceIntegration.isCtCdnMappingEnabled() is false.public void reloadWebResourceMapper()
throws Exception
WebResourceMapper, resetting the current reference to it.
If the new instance is NoOpWebResourceMapper and NoOpWebResourceMapper.reason() returns an
exception, then this exception is thrown.Exception - Reason why NoOpWebResourceMapper and not an operational instance was created.public boolean isJavaScriptTryCatchWrappingEnabled()
public boolean isCSSPrebakingEnabled()
public boolean ignorePrebakeWarnings()
PrebakeWarnings should be considered for prebaking.
It is important to note that resources tainted with
PrebakeErrors will never be considered safe for
prebaking, even when this property is set.PrebakeWarnings, false otherwisepublic boolean isUrlCachingEnabled()
public boolean isUrlGenerationCacheEnabled()
isUrlCachingEnabled instead.public ResourceFactory getResourceFactory()
public boolean isPerformanceTrackingEnabled()
protected boolean getBooleanFromDarkFeatureManagerThenSystemProperty(String name)
Exists to de-couple the WRM from how products manage properties without having to add extra integration work
during adoption to the WebResourceIntegration SPI
name - of the system propertyCopyright © 2024 Atlassian. All rights reserved.