public class DefaultContextRequestHydrator extends Object implements ContextRequestHydrator
ContextRequest
like through an API or other
integration and hydrates all of the data within the ContextRequest
CommonApplicationService
,
CommonCatalogService
Constructor and Description |
---|
DefaultContextRequestHydrator() |
Modifier and Type | Method and Description |
---|---|
protected void |
determineCatalog(ContextRequest request)
Given the requested catalog id (
ContextRequest.getCatalogId() ), figure out the
correct Catalog instance to set on the ContextRequest. |
protected Application |
fetchFromCache(String applicationId,
boolean processCatalog,
boolean isProductionRequest) |
ContextRequest |
hydrate(ContextRequest dehydrated)
Hydrates a ContextRequest with all of the hierarchical tenant data necessary to drive a
discriminated request.
|
void |
setApplicationService(CommonApplicationService<Application> applicationService)
An optional application service used to initialize
ContextRequest.setApplication(Application) from a given
ContextRequest.getApplicationId() |
void |
setAttributesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.core.Authentication,Map<String,Object>> attributesConverter)
Set the appropriate attributes converter for the policy utils.
|
void |
setCatalogService(CommonCatalogService<Catalog> catalogService)
An optional catalog service used to initialize
ContextRequest.setCatalog(Catalog)
from a given ContextRequest.getCatalogId() |
void |
setDataRouteReference(com.broadleafcommerce.common.extension.data.DataRouteReference reference) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
protected void |
setupCurrentCatalog(ContextRequest request)
Establish the
ContextRequest.getCatalogHierarchy() ()} and
ContextRequest.getCatalogLevel() values. |
protected void |
setupSiteInheritanceLines(Application application)
Establish the
Application.getInheritanceLines() value |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrder
@Autowired public void setApplicationService(@Nullable CommonApplicationService<Application> applicationService)
ContextRequest.setApplication(Application)
from a given
ContextRequest.getApplicationId()
applicationService
- a service that can give fully-initialized Application
s@Autowired public void setCatalogService(@Nullable CommonCatalogService<Catalog> catalogService)
ContextRequest.setCatalog(Catalog)
from a given ContextRequest.getCatalogId()
catalogService
- a service that can give fully-initialized Catalog
s@Autowired public void setDataRouteReference(@Nullable com.broadleafcommerce.common.extension.data.DataRouteReference reference)
@Autowired public void setEnvironment(@Nullable org.springframework.core.env.Environment environment)
@Autowired @Qualifier(value="authenticationAttributesConverter") public void setAttributesConverter(@Nullable org.springframework.core.convert.converter.Converter<org.springframework.security.core.Authentication,Map<String,Object>> attributesConverter)
attributesConverter
- the attributes converter to set on policy utilspublic ContextRequest hydrate(ContextRequest dehydrated)
ContextRequest.getApplicationId()
is
non-empty, this will attempt to initialize ContextRequest.setApplication(Application)
from the data store, overwriting any previously-set value.hydrate
in interface ContextRequestHydrator
dehydrated
- a context request that does not have full data initialized on itprotected Application fetchFromCache(String applicationId, boolean processCatalog, boolean isProductionRequest)
protected void setupCurrentCatalog(ContextRequest request)
ContextRequest.getCatalogHierarchy()
()} and
ContextRequest.getCatalogLevel()
values.request
- the request contextprotected void determineCatalog(ContextRequest request)
ContextRequest.getCatalogId()
), figure out the
correct Catalog instance to set on the ContextRequest. For example, for standard sites, the
catalog will generally be the implicit catalog assigned to the site for the requested
catalog. For global sites, the catalog will generally be the same as what was requested.request
- the request contextprotected void setupSiteInheritanceLines(Application application)
Application.getInheritanceLines()
valueapplication
- The recently fetched application instanceCopyright © 2021. All rights reserved.