@Service(value="blURLHandlerService") public class URLHandlerServiceImpl extends Object implements URLHandlerService
Modifier and Type | Field and Description |
---|---|
protected javax.cache.CacheManager |
cacheManager |
protected static NullURLHandler |
NULL_URL_HANDLER |
protected static String |
REGEX_SPECIAL_CHARS_PATTERN |
protected StatisticsService |
statisticsService |
protected javax.cache.Cache<String,URLHandler> |
urlHandlerCache |
protected URLHandlerDao |
urlHandlerDao |
protected Map<String,Pattern> |
urlPatternMap |
Constructor and Description |
---|
URLHandlerServiceImpl() |
Modifier and Type | Method and Description |
---|---|
String |
buildURLHandlerCacheKey(Site site,
String requestUri) |
protected URLHandler |
checkForMatches(String requestURI) |
List<URLHandler> |
findAllRegexURLHandlers()
This is assumed to be a relatively small list of regex URLHandlers (perhaps in the dozens or hundreds of
records at a maximum).
|
List<URLHandler> |
findAllURLHandlers()
Be cautious when calling this.
|
URLHandler |
findURLHandlerById(Long id)
Finds a URLHandler by its ID.
|
URLHandler |
findURLHandlerByURI(String uri)
Checks the passed in URL to determine if there is a matching URLHandler.
|
protected javax.cache.Cache<String,URLHandler> |
getUrlHandlerCache() |
protected URLHandler |
getUrlHandlerFromCache(String key) |
protected String |
manipulateUri(String uri) |
Boolean |
removeURLHandlerFromCache(String mapKey) |
URLHandler |
saveURLHandler(URLHandler handler)
Persists the URLHandler to the DB.
|
protected String |
wrapStringsWithAnchors(String incomingUrl) |
protected static final String REGEX_SPECIAL_CHARS_PATTERN
protected static final NullURLHandler NULL_URL_HANDLER
protected javax.cache.Cache<String,URLHandler> urlHandlerCache
protected URLHandlerDao urlHandlerDao
protected StatisticsService statisticsService
protected javax.cache.CacheManager cacheManager
public URLHandler findURLHandlerByURI(String uri)
findURLHandlerByURI
in interface URLHandlerService
uri
- public URLHandler findURLHandlerById(Long id)
URLHandlerService
findURLHandlerById
in interface URLHandlerService
public List<URLHandler> findAllURLHandlers()
URLHandlerService
findAllURLHandlers
in interface URLHandlerService
public List<URLHandler> findAllRegexURLHandlers()
URLHandlerService
findAllRegexURLHandlers
in interface URLHandlerService
@Transactional(value="blTransactionManager") public URLHandler saveURLHandler(URLHandler handler)
URLHandlerService
saveURLHandler
in interface URLHandlerService
protected URLHandler checkForMatches(String requestURI)
public Boolean removeURLHandlerFromCache(String mapKey)
removeURLHandlerFromCache
in interface URLHandlerService
protected URLHandler getUrlHandlerFromCache(String key)
protected javax.cache.Cache<String,URLHandler> getUrlHandlerCache()
public String buildURLHandlerCacheKey(Site site, String requestUri)
buildURLHandlerCacheKey
in interface URLHandlerService
Copyright © 2022. All rights reserved.