KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > htmlcache > CacheEntry


1 package org.jahia.services.htmlcache;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.HashMap JavaDoc;
6 import java.util.Map JavaDoc;
7
8 /**
9  * <p>Title: Represents an entry in the content cache.</p>
10  * <p>Description: The purpose of this object is to offer not just content
11  * cache but also to offer the possibility to add meta-data to this content.
12  * In order to do this all the content is stored in a Property table.</p>
13  * <p>This class offers default properties such as contentType, contentData,
14  * lastAccessDate and hits but also offers a generic hash map to extend the
15  * possibilities of using meta-data for a cache entry.</p>
16  * <p>Copyright: Copyright (c) 2002</p>
17  * <p>Company: Jahia Ltd</p>
18  * @author Serge Huber
19  * @version 1.0
20  */

21
22 public class CacheEntry implements Serializable JavaDoc {
23
24     private String JavaDoc contentBody = "";
25     private String JavaDoc contentType = "";
26     private Date JavaDoc lastAccessDate = new Date JavaDoc();
27     private int hits = 0;
28     private String JavaDoc operationMode = ""; // this can take the values
29
// "normal", "edit" or "debug" (see ParamBean defined modes)
30

31     private Map JavaDoc extendedProperties = new HashMap JavaDoc();
32     private Date JavaDoc expirationDate = null;
33
34     public void setProperty(String JavaDoc name, Object JavaDoc value) {
35         this.extendedProperties.put(name, value);
36     }
37
38     public Object JavaDoc getProperty(String JavaDoc name) {
39         return this.extendedProperties.get(name);
40     }
41
42     public Map JavaDoc getExtendedProperties() {
43         return extendedProperties;
44     }
45
46     public void setExtendedProperties(Map JavaDoc newProps) {
47         this.extendedProperties = newProps;
48     }
49
50     public String JavaDoc getContentType() {
51         return contentType;
52     }
53
54     public void setContentType(String JavaDoc contentType) {
55         this.contentType = contentType;
56     }
57
58     public String JavaDoc getContentBody() {
59         return contentBody;
60     }
61
62     public void setContentBody(String JavaDoc contentBody) {
63         this.contentBody = contentBody;
64     }
65
66     public Date JavaDoc getLastAccessDate() {
67         return lastAccessDate;
68     }
69
70     public void setLastAccessDate(Date JavaDoc accessDate) {
71         this.lastAccessDate = accessDate;
72     }
73
74     public int getHits() {
75         return hits;
76     }
77
78     public void setHits(int hits) {
79         this.hits = hits;
80     }
81
82     public String JavaDoc getOperationMode() {
83         return this.operationMode;
84     }
85
86     public void setOperationMode(String JavaDoc opMode) {
87         this.operationMode = opMode;
88     }
89     public java.util.Date JavaDoc getExpirationDate() {
90         return expirationDate;
91     }
92     public void setExpirationDate(java.util.Date JavaDoc expirationDate) {
93         this.expirationDate = expirationDate;
94     }
95
96 }
Popular Tags