@SuppressWarnings("rawtypes")
public EHCachingConfigMaster(final String name, final ConfigMaster underlying, final CacheManager cacheManager) {
super(name + "Config", underlying, cacheManager);
// Create the doc search cache and register a config master searcher
_documentSearchCache = new EHCachingSearchCache(name + "Config", cacheManager, new EHCachingSearchCache.Searcher() {
@Override
public ObjectsPair<Integer, List<UniqueId>> search(Bean request, PagingRequest pagingRequest) {
// Fetch search results from underlying master
ConfigSearchResult<?> result =
((ConfigMaster) getUnderlying()).search((ConfigSearchRequest<?>)
EHCachingSearchCache.withPagingRequest((AbstractSearchRequest) request, pagingRequest));
// Cache the result documents
EHCachingSearchCache.cacheDocuments(result.getDocuments(), getUidToDocumentCache());
// Return the list of result UniqueIds
return new ObjectsPair<>(result.getPaging().getTotalItems(),
EHCachingSearchCache.extractUniqueIds(result.getDocuments()));
}
});
// Create the history search cache and register a security master searcher
_historySearchCache = new EHCachingSearchCache(name + "ConfigHistory", cacheManager, new EHCachingSearchCache.Searcher() {
@SuppressWarnings("unchecked")
@Override
public ObjectsPair<Integer, List<UniqueId>> search(Bean request, PagingRequest pagingRequest) {
// Fetch search results from underlying master
ConfigHistoryResult result = ((ConfigMaster) getUnderlying()).history((ConfigHistoryRequest)