/** * This constructor is used when building a cache key from set of cache directives.<p> * * These directives are attached to the properties of the requested resource * on a property called "cache". * The value of this poperty that is passed in this constructor as "cacheDirectives" * is parsed to build the keys data structure.<p> * * In case a parsing error occures, the value of this key is set to "cache=never", * and the hadParseError() flag is set to true. * This is done to ensure that a valid key is always constructed with the constructor.<p> * * @param resourcename the full name of the resource including site root * @param cacheDirectives the cache directives of the resource (value of the property "cache") * @param online must be true for an online resource, false for offline resources */ public CmsFlexCacheKey(String resourcename, String cacheDirectives, boolean online) { m_resource = getKeyName(resourcename, online); m_variation = "never"; m_always = -1; m_timeout = -1; if (cacheDirectives != null) { parseFlexKey(cacheDirectives); } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCACHEKEY_GENERATED_1, toString())); } }
/** * This constructor is used when building a cache key from set of cache directives.<p> * * These directives are attached to the properties of the requested resource * on a property called "cache". * The value of this poperty that is passed in this constructor as "cacheDirectives" * is parsed to build the keys data structure.<p> * * In case a parsing error occures, the value of this key is set to "cache=never", * and the hadParseError() flag is set to true. * This is done to ensure that a valid key is always constructed with the constructor.<p> * * @param resourcename the full name of the resource including site root * @param cacheDirectives the cache directives of the resource (value of the property "cache") * @param online must be true for an online resource, false for offline resources */ public CmsFlexCacheKey(String resourcename, String cacheDirectives, boolean online) { m_resource = getKeyName(resourcename, online); m_variation = "never"; m_always = -1; m_timeout = -1; if (cacheDirectives != null) { parseFlexKey(cacheDirectives); } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCACHEKEY_GENERATED_1, toString())); } }
/** * This constructor is used when building a cache key from a request.<p> * * The request contains several data items that are neccessary to construct * the output. These items are e.g. the Query-String, the requested resource, * the current time etc. etc. * All required items are saved in the constructed cache - key.<p> * * @param req the request to construct the key for * @param target the requested resource in the OpenCms VFS * @param online must be true for an online resource, false for offline resources */ public CmsFlexRequestKey(HttpServletRequest req, String target, boolean online) { // store the request m_request = req; // fetch the cms from the request CmsObject cms = CmsFlexController.getCmsObject(req); // store the request context m_context = cms.getRequestContext(); // calculate the resource name m_resource = CmsFlexCacheKey.getKeyName(m_context.addSiteRoot(target), online); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXREQUESTKEY_CREATED_NEW_KEY_1, m_resource)); } }
m_resource = CmsFlexCacheKey.getKeyName(m_context.addSiteRoot(target), online);
CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) {
CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) {