public class Controller extends BaseController
Intended to be used with one instance per request to handle
globals, request, response| Constructor and Description |
|---|
Controller(Globals globals,
Request request,
Response response) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildCacheKey()
Creates cache key for resource or batch.
|
protected boolean |
checkIfCachedAndNotModified(Date updatedAt)
Check if resource is not modified and replies with not-modified response if so.
|
protected List<Resource> |
getBatchResources(RawRequest raw,
String type,
boolean resolveDependencies,
boolean withLegacyConditions)
Get Resources for Batch (all types of Batch - Web Resource Batch, Super Batch, Context Batch).
|
protected Resource |
getResourceRelativeToBatch(RawRequest raw,
String resourceName,
boolean resolveDependencies,
boolean withLegacyConditions)
Get Resource relative to Batch.
|
protected boolean |
handleNotFoundRedirectAndNotModified(Resource resource)
Handle not found resources, redirects and not modified resources.
|
protected boolean |
isSourceMapEnabled()
If Source Map is enabled for the current Request.
|
protected void |
sendCached(Content content,
Map<String,String> params,
boolean isCachingEnabled) |
void |
serveBatch(RawRequest raw,
ServingType servingType,
String type,
boolean resolveDependencies,
boolean withLegacyConditions,
boolean isCachingEnabled,
boolean verifyBundleHash)
Serves Batch (all types of Batch - Web Resource Batch, Super Batch, Context Batch).
|
void |
serveBatchSourceMap(RawRequest raw,
ServingType servingType,
String type,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Source Map for Batch.
|
protected void |
serveResource(RawRequest raw,
Resource resource)
Causes the content inside resource to be served in response.
|
protected void |
serveResource(RawRequest raw,
Resource resource,
boolean applyTransformations,
boolean isCachingEnabled) |
void |
serveResource(String completeKey,
String resourceName,
ServingType servingType)
Serves single Resource.
|
void |
serveResourceRelativeToBatch(RawRequest raw,
String resourceName,
ServingType servingType,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Resource relative to Batch.
|
void |
serveResourceRelativeToBatchSourceMap(RawRequest raw,
String resourceName,
ServingType servingType,
boolean resolveDependencies,
boolean withLegacyConditions)
Serves Source Map for Resource relative to Batch.
|
protected void |
serveResources(RawRequest raw,
Supplier<Collection<Resource>> resources,
boolean isCachingEnabled)
Causes all content inside every
Resource provided by resources to be served in response. |
void |
serveResourceSourceMap(String completeKey,
String resourceName,
ServingType servingType)
Serves Source Map for single Resource.
|
void |
serveSource(String completeKey,
String resourceName,
ServingType servingType)
Serves Source Code of the Resource.
|
protected void |
serveSourceMap(RawRequest raw,
Resource resource)
Serves Source Map.
|
public void serveResource(String completeKey, String resourceName, ServingType servingType)
public void serveResourceSourceMap(String completeKey, String resourceName, ServingType servingType)
public void serveBatch(RawRequest raw, ServingType servingType, String type, boolean resolveDependencies, boolean withLegacyConditions, boolean isCachingEnabled, boolean verifyBundleHash)
raw - all included and excluded Requestable.type - type of Batch.resolveDependencies - if dependencies should be resolved.verifyBundleHash - if bundle hash in the request url should be verified against what we currently have in the systempublic void serveBatchSourceMap(RawRequest raw, ServingType servingType, String type, boolean resolveDependencies, boolean withLegacyConditions)
raw - all included and excluded Requestable.type - type of Batch.resolveDependencies - if dependencies should be resolved.protected List<Resource> getBatchResources(RawRequest raw, String type, boolean resolveDependencies, boolean withLegacyConditions)
raw - all included and excluded Requestable.type - type of Batch.resolveDependencies - if dependencies should be resolved.public void serveResourceRelativeToBatch(RawRequest raw, String resourceName, ServingType servingType, boolean resolveDependencies, boolean withLegacyConditions)
raw - all included and excluded Requestable.resourceName - name attribute of <resource> to be served from within a requested web-resource.resolveDependencies - if dependencies should be resolved.public void serveResourceRelativeToBatchSourceMap(RawRequest raw, String resourceName, ServingType servingType, boolean resolveDependencies, boolean withLegacyConditions)
protected Resource getResourceRelativeToBatch(RawRequest raw, String resourceName, boolean resolveDependencies, boolean withLegacyConditions)
public void serveSource(String completeKey, String resourceName, ServingType servingType)
protected void serveResource(RawRequest raw, Resource resource)
raw - all included and excluded Requestable.resource - the tangible Resource whose content should be served and should exist somewhere in raw.protected void serveResource(RawRequest raw, Resource resource, boolean applyTransformations, boolean isCachingEnabled)
protected void serveResources(RawRequest raw, Supplier<Collection<Resource>> resources, boolean isCachingEnabled)
Resource provided by resources to be served in response.raw - all included and excluded Requestable.resources - an ordered list of Resource whose content should be served.
Each should be reachable via one of the Requestable referenced in raw.protected void serveSourceMap(RawRequest raw, Resource resource)
protected boolean handleNotFoundRedirectAndNotModified(Resource resource)
protected boolean checkIfCachedAndNotModified(Date updatedAt)
updatedAt - when resource has been updated.protected void sendCached(Content content, Map<String,String> params, boolean isCachingEnabled)
protected String buildCacheKey()
protected boolean isSourceMapEnabled()
Copyright © 2024 Atlassian. All rights reserved.