📄 cacheentry.java
字号:
package org.jahia.services.htmlcache;import java.io.Serializable;import java.util.Date;import java.util.HashMap;import java.util.Map;/** * <p>Title: Represents an entry in the content cache.</p> * <p>Description: The purpose of this object is to offer not just content * cache but also to offer the possibility to add meta-data to this content. * In order to do this all the content is stored in a Property table.</p> * <p>This class offers default properties such as contentType, contentData, * lastAccessDate and hits but also offers a generic hash map to extend the * possibilities of using meta-data for a cache entry.</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: Jahia Ltd</p> * * @author Serge Huber * @version 1.0 */public class CacheEntry implements Serializable { /** the normal operation mode constant. */ public static final String MODE_NORMAL = "normal"; /** the debugging operation mode constant. */ public static final String MODE_DEBUG = "debug"; /** the edition operation mode constant. */ public static final String MODE_EDIT = "edit"; private String contentBody = ""; private String contentType = ""; /** last accessed date. */ protected Date lastAccessedDate = new Date (); /** number of time the entry was requested. */ protected int hits = 0; /** the operation mode. */ protected String operationMode = ""; // this can take the values // "normal", "edit" or "debug" (see ParamBean defined modes) private Map extendedProperties = new HashMap(); /** the entry's expiration date. */ protected Date expirationDate; public void setProperty(String name, Object value) { extendedProperties.put (name, value); } public final Object getProperty (String name) { return extendedProperties.get (name); } public final Map getExtendedProperties () { return extendedProperties; } public void setExtendedProperties(Map newProps) { this.extendedProperties = newProps; } public final String getContentType () { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public final String getContentBody () { return contentBody; } public void setContentBody(String contentBody) { this.contentBody = contentBody; } public final Date getLastAccessDate () { return lastAccessedDate; } public void setLastAccessDate(Date accessDate) { this.lastAccessedDate = accessDate; } public final int getHits () { return hits; } public void setHits(int hits) { this.hits = hits; } public final String getOperationMode () { return operationMode; } public void setOperationMode(String opMode) { this.operationMode = opMode; } public final Date getExpirationDate () { return expirationDate; } public void setExpirationDate (Date expirationDate) { this.expirationDate = expirationDate; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -