@Service(value="blClassNameRequestParamValidationService") public class ClassNameRequestParamValidationServiceImpl extends Object implements ClassNameRequestParamValidationService
ClassNameRequestParamValidationService
Modifier and Type | Field and Description |
---|---|
protected AdminNavigationService |
adminNavigationService |
protected javax.persistence.EntityManagerFactory |
factory |
protected DynamicDaoHelper |
helper |
protected PersistenceService |
persistenceService |
Constructor and Description |
---|
ClassNameRequestParamValidationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
String |
getClassNameForSection(String sectionKey)
Retrieve a fully qualified classname using a sectionKey.
|
List<SectionCrumb> |
getSectionCrumbs(String crumbList)
Retrieve a list of section crumbs given a delimited string (usually harvested from the "sectionCrumbs" param on a
Http request).
|
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 PersistenceService persistenceService
protected DynamicDaoHelper helper
public ClassNameRequestParamValidationServiceImpl()
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)
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 classnamepublic List<SectionCrumb> getSectionCrumbs(String crumbList)
ClassNameRequestParamValidationService
ClassNameRequestParamValidationService.getClassNameForSection(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)Copyright © 2019. All rights reserved.