Package org.opencms.main
Class OpenCmsServlet.RequestCache
- java.lang.Object
-
- org.opencms.main.OpenCmsServlet.RequestCache
-
- Enclosing class:
- OpenCmsServlet
public static class OpenCmsServlet.RequestCache extends java.lang.Object
Context class for storing request-dependent caches etc.
-
-
Constructor Summary
Constructors Constructor Description RequestCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLog(java.lang.String channel, java.lang.String level, java.lang.String message)
Adds a log message to the log buffer.void
close()
Called at the end of the request.java.lang.Object
getAttribute(java.lang.String key)
Gets the attribute for the given key.java.lang.Object
getAttribute(java.lang.String key, java.util.function.Function<java.lang.String,java.lang.Object> provider)
Gets the stored attribute for the given key, or lazily initializes it with the given provider function if it doesn't exist yet.CmsADEConfigData
getCachedConfig(java.lang.String key)
Gets the cached sitemap configuration data.void
setAttribute(java.lang.String key, java.lang.Object value)
Sets the attribute for the given key.void
setCachedConfig(java.lang.String key, CmsADEConfigData config)
Sets the cached sitemap configuration data.
-
-
-
Constructor Detail
-
RequestCache
public RequestCache()
-
-
Method Detail
-
addLog
public void addLog(java.lang.String channel, java.lang.String level, java.lang.String message)
Adds a log message to the log buffer.- Parameters:
channel
- the channellevel
- the log levelmessage
- the message
-
close
public void close()
Called at the end of the request.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String key)
Gets the attribute for the given key.- Parameters:
key
- the key- Returns:
- the attribute
-
getAttribute
public java.lang.Object getAttribute(java.lang.String key, java.util.function.Function<java.lang.String,java.lang.Object> provider)
Gets the stored attribute for the given key, or lazily initializes it with the given provider function if it doesn't exist yet.- Parameters:
key
- the keyprovider
- the function to lazily initialize the entry- Returns:
- the attribute
-
getCachedConfig
public CmsADEConfigData getCachedConfig(java.lang.String key)
Gets the cached sitemap configuration data.- Parameters:
key
- the key- Returns:
- the sitemap config from the cache
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.Object value)
Sets the attribute for the given key.- Parameters:
key
- the keyvalue
- the attribute value
-
setCachedConfig
public void setCachedConfig(java.lang.String key, CmsADEConfigData config)
Sets the cached sitemap configuration data.- Parameters:
key
- the keyconfig
- the sitemap configuration to cache
-
-