use of org.apereo.portal.utils.cache.CacheKey.CacheKeyBuilder in project uPortal by Jasig.
the class StylesheetDescriptorTransformerConfigurationSource method getCacheKey.
@Override
public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final CacheKeyBuilder cacheKeyBuilder = CacheKey.builder(this.getName());
final PreferencesScope preferencesScope = this.getStylesheetPreferencesScope(request);
final IStylesheetDescriptor stylesheetDescriptor = this.stylesheetUserPreferencesService.getStylesheetDescriptor(request, preferencesScope);
// Build key from stylesheet descriptor parameters
for (final IStylesheetParameterDescriptor stylesheetParameterDescriptor : stylesheetDescriptor.getStylesheetParameterDescriptors()) {
final String defaultValue = stylesheetParameterDescriptor.getDefaultValue();
if (defaultValue != null) {
final String name = stylesheetParameterDescriptor.getName();
cacheKeyBuilder.put(name, defaultValue);
}
}
return cacheKeyBuilder.build();
}
use of org.apereo.portal.utils.cache.CacheKey.CacheKeyBuilder in project uPortal by Jasig.
the class PortletWindowAttributeSource method getCacheKey.
@Override
public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final Set<IPortletWindow> portletWindows = this.portletWindowRegistry.getAllLayoutPortletWindows(request);
final CacheKeyBuilder cacheKeyBuilder = CacheKey.builder(this.name);
for (final IPortletWindow portletWindow : portletWindows) {
if (portletWindow != null) {
final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId();
final WindowState windowState = portletWindow.getWindowState();
final PortletMode portletMode = portletWindow.getPortletMode();
cacheKeyBuilder.addAll(portletWindowId, windowState.toString(), portletMode.toString());
} else {
this.logger.warn("portletWindowRegistry#getAllLayoutPortletWindows() returned a null portletWindow");
}
}
return cacheKeyBuilder.build();
}
use of org.apereo.portal.utils.cache.CacheKey.CacheKeyBuilder in project uPortal by Jasig.
the class PortletDefinitionAttributeSource method getCacheKey.
@Override
public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final CacheKeyBuilder cacheKeyBuilder = CacheKey.builder(this.name);
// We need something that makes for a unique cache key. For lack of anything else useful,
// use the set of all layout portlet window ids in the user's layout.
final Set<IPortletWindow> portletWindows = this.portletWindowRegistry.getAllLayoutPortletWindows(request);
for (final IPortletWindow portletWindow : portletWindows) {
if (portletWindow != null) {
final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId();
cacheKeyBuilder.add(portletWindowId);
} else {
this.logger.warn("portletWindowRegistry#getAllLayoutPortletWindows() returned a null portletWindow");
}
}
return cacheKeyBuilder.build();
}
use of org.apereo.portal.utils.cache.CacheKey.CacheKeyBuilder in project uPortal by Jasig.
the class MergingTransformerConfigurationSource method getCacheKey.
/* (non-Javadoc)
* @see org.apereo.portal.rendering.xslt.TransformerConfigurationSource#getTransformerConfigurationKey(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final CacheKeyBuilder cacheKeyBuilder = CacheKey.builder(this.getClass().getName());
for (final TransformerConfigurationSource source : this.sources) {
final CacheKey key = source.getCacheKey(request, response);
cacheKeyBuilder.add(key);
}
return cacheKeyBuilder.build();
}
Aggregations