public class UrlGenerationHelpers extends BaseHelpers
| Constructor and Description |
|---|
UrlGenerationHelpers() |
| Modifier and Type | Method and Description |
|---|---|
protected static UrlCache.IncludedExcludedConditionsAndBatchingOptions |
buildIncludedExcludedConditionsAndBatchingOptions(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
Collection<String> topLevelIncluded,
Collection<String> topLevelExcluded)
Building the cache key of included, excluded and conditions.
|
protected static CalculatedBatches |
calculateBatches(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
LinkedHashSet<String> topLevelIncluded,
LinkedHashSet<String> allExcluded)
Deprecated.
since 5.5.0.
Use
calculateBatches(RequestCache, UrlBuildingStrategy, LinkedHashSet, LinkedHashSet, Set) instead. |
protected static CalculatedBatches |
calculateBatches(RequestCache requestCache,
UrlBuildingStrategy urlBuildingStrategy,
LinkedHashSet<String> topLevelIncluded,
LinkedHashSet<String> allExcluded,
Set<String> topLevelExcluded)
Groups given web resources and contexts in to batches, taking
any content that has already been served in to account.
|
static String |
calculateBundleHash(RawRequest rawRequest,
RequestCache requestCache)
Calculates URL resource hashes for given request.
|
static String |
calculateBundlesHash(List<Bundle> bundles) |
protected static List<ResourceUrl> |
collectUrlStateAndBuildResourceUrls(RequestState requestState,
UrlBuildingStrategy urlBuilderStrategy,
List<ContextBatch> contextBatches,
List<WebResourceBatch> webResourceBatches)
Collect URL State for Conditions and Transformers and build Resource URLs.
|
protected static List<ResourceUrl> |
createResourceUrlsForRedirectResources(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
List<Resource> resources)
Creates Resource URLs for redirect resources.
|
protected static StateEncodedUrlResult |
encodeStateInUrlIfSupported(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
String type,
Map<String,String> params,
Bundle bundle,
List<Bundle> skipped,
List<Bundle> excludedWithoutApplyingConditions)
Collect and encode URL state for given Resources, it collects resource params, condition params and transformer params.
|
protected static StateEncodedUrlResult |
encodeStateInUrlIfSupported(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
String type,
Map<String,String> params,
List<Bundle> bundles,
List<Bundle> skipped,
List<Bundle> excludedWithoutApplyingConditions)
Collect and encode URL state for given Resources, it collects resource params, condition params and transformer params.
|
static Set<String> |
resolveExcluded(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
Collection<String> topLevelIncluded,
Collection<String> topLevelExcluded)
Deprecated.
use
DependencyGraph or BundleFinder instead
to avoid generating an entire URL set just to traverse the dependency graph. |
static Set<String> |
resolveExcluded(RequestCache requestCache,
UrlCache urlCache,
UrlBuildingStrategy urlBuilderStrategy,
Collection<String> topLevelIncluded,
Collection<String> topLevelExcluded)
Deprecated.
use
DependencyGraph or BundleFinder instead
to avoid generating an entire URL set just to traverse the dependency graph. |
static List<Resource> |
resourcesOfType(Collection<Resource> resources,
String type)
Get resources of given type.
|
protected static com.atlassian.plugin.webresource.impl.helpers.url.SplitSubBatches |
splitBatchIntoSubBatches(RequestCache requestCache,
Found found,
boolean doSorting)
Split batch into sub batches and standalone resources, same code used to split both context and resource batches.
|
static Tuple<List<ContextBatch>,List<WebResourceBatch>> |
splitIntoSubBatches(RequestCache requestCache,
UrlBuildingStrategy urlBuilderStrategy,
List<ContextBatchKey> contextBatchKeys,
List<String> webResourceBatchKeys,
Set<String> allExcluded)
Split batches into sub batches grouped by URL parameters and set of standalone resources.
|
hasConditions, hasLegacyCondition, isConditionsSatisfied, isConditionsSatisfiedprotected static UrlCache.IncludedExcludedConditionsAndBatchingOptions buildIncludedExcludedConditionsAndBatchingOptions(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, Collection<String> topLevelIncluded, Collection<String> topLevelExcluded)
@Deprecated public static Set<String> resolveExcluded(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, Collection<String> topLevelIncluded, Collection<String> topLevelExcluded)
DependencyGraph or BundleFinder instead
to avoid generating an entire URL set just to traverse the dependency graph.@Deprecated public static Set<String> resolveExcluded(RequestCache requestCache, UrlCache urlCache, UrlBuildingStrategy urlBuilderStrategy, Collection<String> topLevelIncluded, Collection<String> topLevelExcluded)
DependencyGraph or BundleFinder instead
to avoid generating an entire URL set just to traverse the dependency graph.requestCache - request cache. Used to look up previous condition evaluation results.topLevelIncluded - the "entry point" web resources and contexts the client has requested.
conditions will be considered when discovering content via these items.topLevelExcluded - the "entry point" web resources and contexts the client has already
loaded and should not be served again. Conditions will NOT be considered
when disovering content via these items.@Deprecated protected static CalculatedBatches calculateBatches(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, LinkedHashSet<String> topLevelIncluded, LinkedHashSet<String> allExcluded)
calculateBatches(RequestCache, UrlBuildingStrategy, LinkedHashSet, LinkedHashSet, Set) instead.protected static CalculatedBatches calculateBatches(RequestCache requestCache, UrlBuildingStrategy urlBuildingStrategy, LinkedHashSet<String> topLevelIncluded, LinkedHashSet<String> allExcluded, Set<String> topLevelExcluded)
requestCache - request cache.urlBuildingStrategy - how conditions and transformers contribute to generated URLs.topLevelIncluded - the "entry point" web resources and contexts the client has requested.topLevelExcluded - the "entry point" web resources and contexts that were explicitly excluded
from the request by the client. Used toallExcluded - all web resources discoverable through the topLevelExcluded set.
This should be a superset of topLevelExcluded - that is, all "entry point"
web-resources and contexts should also be present here. Used to determine what has already been
served to the client and avoid re-serving the same content.CalculatedBatches that represents the batch groups to serve to the client, along
with a list of all items that should be omitted from subsequent client requests.protected static List<ResourceUrl> collectUrlStateAndBuildResourceUrls(RequestState requestState, UrlBuildingStrategy urlBuilderStrategy, List<ContextBatch> contextBatches, List<WebResourceBatch> webResourceBatches)
public static Tuple<List<ContextBatch>,List<WebResourceBatch>> splitIntoSubBatches(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, List<ContextBatchKey> contextBatchKeys, List<String> webResourceBatchKeys, Set<String> allExcluded)
contextBatchKeys - keys of context batcheswebResourceBatchKeys - keys of web resource batches.public static String calculateBundleHash(RawRequest rawRequest, RequestCache requestCache)
rawRequest - raw request.requestCache - request cache.protected static com.atlassian.plugin.webresource.impl.helpers.url.SplitSubBatches splitBatchIntoSubBatches(RequestCache requestCache, Found found, boolean doSorting)
found - list of complete keys that the batch contains.doSorting - some legacy stuff, in some cases it sorted in some not.public static List<Resource> resourcesOfType(Collection<Resource> resources, String type)
protected static StateEncodedUrlResult encodeStateInUrlIfSupported(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, String type, Map<String,String> params, Bundle bundle, List<Bundle> skipped, List<Bundle> excludedWithoutApplyingConditions)
protected static StateEncodedUrlResult encodeStateInUrlIfSupported(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, String type, Map<String,String> params, List<Bundle> bundles, List<Bundle> skipped, List<Bundle> excludedWithoutApplyingConditions)
protected static List<ResourceUrl> createResourceUrlsForRedirectResources(RequestCache requestCache, UrlBuildingStrategy urlBuilderStrategy, List<Resource> resources)
Copyright © 2024 Atlassian. All rights reserved.