@Service(value="blClassNameRequestParamValidationService") public class ClassNameRequestParamValidationServiceImpl extends Object implements ClassNameRequestParamValidationService, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
ClassNameRequestParamValidationService
Modifier and Type | Field and Description |
---|---|
protected AdminNavigationService |
adminNavigationService |
protected javax.persistence.EntityManagerFactory |
factory |
protected DynamicDaoHelper |
helper |
Constructor and Description |
---|
ClassNameRequestParamValidationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
String |
getClassNameForSection(String sectionKey,
String persistenceUnitName)
Retrieve a fully qualified classname using a sectionKey.
|
List<SectionCrumb> |
getSectionCrumbs(String crumbList,
String persistenceUnitName)
Retrieve a list of section crumbs given a delimited string (usually harvested from the "sectionCrumbs" param on a
Http request).
|
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
boolean |
validateClassNameParams(Map<String,String> requestParamToClassName,
String persistenceUnitName)
Compare a map of request params to fully qualified classname values against the whitelist.
|
protected javax.persistence.EntityManagerFactory factory
protected AdminNavigationService adminNavigationService
protected DynamicDaoHelper helper
public ClassNameRequestParamValidationServiceImpl()
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public boolean validateClassNameParams(Map<String,String> requestParamToClassName, String persistenceUnitName)
ClassNameRequestParamValidationService
validateClassNameParams
in interface ClassNameRequestParamValidationService
requestParamToClassName
- a map of request params and associated fully qualified classnames to confirm against the whitelistpersistenceUnitName
- the persistence unit the white list is generated frompublic String getClassNameForSection(String sectionKey, String persistenceUnitName)
ClassNameRequestParamValidationService
SectionKeyValidationException
instance is
thrown. If thrown from within a Spring MVC controller, this exception will result in an Http 404 status code
back to the requester.getClassNameForSection
in interface ClassNameRequestParamValidationService
sectionKey
- the sectionKey used to retrieve the fully qualified classnamepersistenceUnitName
- the persistence unit the white list is generated frompublic List<SectionCrumb> getSectionCrumbs(String crumbList, String persistenceUnitName)
ClassNameRequestParamValidationService
ClassNameRequestParamValidationService.getClassNameForSection(String, String)
. If a sectionKey is found
to be not valid, a SectionKeyValidationException
instance is
thrown. If thrown from within a Spring MVC controller, this exception will result in an Http 404 status code
back to the requester.getSectionCrumbs
in interface ClassNameRequestParamValidationService
crumbList
- the delimited string (related to the "sectionCrumbs" param in an Http request)persistenceUnitName
- the persistence unit the white list is generated fromCopyright © 2020. All rights reserved.