Class URLHandlerServiceImpl
java.lang.Object
org.broadleafcommerce.cms.url.service.URLHandlerServiceImpl
- All Implemented Interfaces:
URLHandlerService
@Service("blURLHandlerService")
public class URLHandlerServiceImpl
extends Object
implements URLHandlerService
Created by bpolster.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.cache.CacheManager
protected static final NullURLHandler
protected static final String
protected StatisticsService
protected javax.cache.Cache<String,
URLHandler> protected URLHandlerDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildURLHandlerCacheKey
(Site site, String requestUri) protected URLHandler
checkForMatches
(String requestURI) This is assumed to be a relatively small list of regex URLHandlers (perhaps in the dozens or hundreds of records at a maximum).Be cautious when calling this.Finds a URLHandler by its ID.Checks the passed in URL to determine if there is a matching URLHandler.protected javax.cache.Cache<String,
URLHandler> protected URLHandler
protected String
manipulateUri
(String uri) removeURLHandlerFromCache
(String mapKey) saveURLHandler
(URLHandler handler) Persists the URLHandler to the DB.protected String
wrapStringsWithAnchors
(String incomingUrl)
-
Field Details
-
REGEX_SPECIAL_CHARS_PATTERN
- See Also:
-
NULL_URL_HANDLER
-
urlHandlerCache
-
urlHandlerDao
-
statisticsService
-
cacheManager
protected javax.cache.CacheManager cacheManager -
urlPatternMap
-
-
Constructor Details
-
URLHandlerServiceImpl
public URLHandlerServiceImpl()
-
-
Method Details
-
findURLHandlerByURI
Checks the passed in URL to determine if there is a matching URLHandler. Returns null if no handler was found.- Specified by:
findURLHandlerByURI
in interfaceURLHandlerService
- Parameters:
uri
-- Returns:
-
findURLHandlerById
Description copied from interface:URLHandlerService
Finds a URLHandler by its ID.- Specified by:
findURLHandlerById
in interfaceURLHandlerService
- Returns:
-
findAllURLHandlers
Description copied from interface:URLHandlerService
Be cautious when calling this. If there are a large number of records, this can cause performance and memory issues.- Specified by:
findAllURLHandlers
in interfaceURLHandlerService
- Returns:
-
findAllRegexURLHandlers
Description copied from interface:URLHandlerService
This is assumed to be a relatively small list of regex URLHandlers (perhaps in the dozens or hundreds of records at a maximum). Having large number of records here (more 1000, for example) is not likely necessary to accomplish the desired goal, and can cause performance problems.- Specified by:
findAllRegexURLHandlers
in interfaceURLHandlerService
- Returns:
-
saveURLHandler
Description copied from interface:URLHandlerService
Persists the URLHandler to the DB.- Specified by:
saveURLHandler
in interfaceURLHandlerService
- Returns:
-
checkForMatches
-
removeURLHandlerFromCache
- Specified by:
removeURLHandlerFromCache
in interfaceURLHandlerService
-
manipulateUri
-
getUrlHandlerFromCache
-
getUrlHandlerCache
-
buildURLHandlerCacheKey
- Specified by:
buildURLHandlerCacheKey
in interfaceURLHandlerService
-
wrapStringsWithAnchors
-