KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > cache > HtmlCacheEntry


1 /*
2  * ____.
3  * __/\ ______| |__/\. _______
4  * __ .____| | \ | +----+ \
5  * _______| /--| | | - \ _ | : - \_________
6  * \\______: :---| : : | : | \________>
7  * |__\---\_____________:______: :____|____:_____\
8  * /_____|
9  *
10  * . . . i n j a h i a w e t r u s t . . .
11  *
12  *
13  *
14  * ----- BEGIN LICENSE BLOCK -----
15  * Version: JCSL 1.0
16  *
17  * The contents of this file are subject to the Jahia Community Source License
18  * 1.0 or later (the "License"); you may not use this file except in
19  * compliance with the License. You may obtain a copy of the License at
20  * http://www.jahia.org/license
21  *
22  * Software distributed under the License is distributed on an "AS IS" basis,
23  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
24  * for the rights, obligations and limitations governing use of the contents
25  * of the file. The Original and Upgraded Code is the Jahia CMS and Portal
26  * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
27  * Ltd. owns the copyrights in the portions it created. All Rights Reserved.
28  *
29  * The Developer of the Shared Modifications is Jahia Solution Sarl.
30  * Portions created by the Initial Developer are Copyright (C) 2002 by the
31  * Initial Developer. All Rights Reserved.
32  *
33  * Contributor(s):
34  * ??-JUN-2003, Jahia Solutions Sarl, Fulco Houkes : Initial version
35  *
36  * ----- END LICENSE BLOCK -----
37  */

38
39
40 package org.jahia.services.cache;
41
42 import java.io.Serializable JavaDoc;
43
44
45 /** <p>This class represents an HTML page stored into an cache entry of the Html Cache.
46  * Each page is defined by the page's body content and its content type.</p>
47  *
48  * @author Fulco Houkes, Copyright (c) 2003 by Jahia Ltd.
49  * @version 1.0
50  * @since Jahia 4.0
51  * @see org.jahia.services.cache.HtmlCache HtmlCache
52  */

53
54 public class HtmlCacheEntry implements Serializable JavaDoc {
55
56     /** the HTML body content. */
57     private String JavaDoc contentBody = "";
58
59     /** the HTML content type. */
60     private String JavaDoc contentType = "";
61
62
63
64     /** <p>Creates a new <code>HtmlCacheEntry</code> instance.</p>
65      *
66      * @param contentBody the HTML content body
67      */

68     public HtmlCacheEntry (String JavaDoc contentBody) {
69         init (contentBody, null);
70     }
71
72
73     /** <p>Creates a new <code>HtmlCacheEntry</code> object instance.</p>
74      *
75      * @param contentBody the HTML content body
76      * @param contentType the HTML content type
77      */

78     public HtmlCacheEntry (String JavaDoc contentBody, String JavaDoc contentType) {
79         init (contentBody, contentType);
80     }
81
82
83     /** <p>Initialize the class.</p>
84      *
85      * @param contentBody the HTML content body
86      * @param contentType the HTML content type
87      */

88     private void init (String JavaDoc contentBody, String JavaDoc contentType) {
89         if (contentBody != null)
90             this.contentBody = contentBody;
91
92         if (contentType != null)
93             this.contentType = contentType;
94     }
95
96
97     /** <p>Retrieves the content type of the HTML page.<p>
98      *
99      * @return the HTML content type
100      */

101     final public String JavaDoc getContentType() {
102         return contentType;
103     }
104
105
106     /** <p>Sets the HTML content type.<p>
107      *
108      * @param contentType the HTML content type
109      */

110     final public void setContentType (String JavaDoc contentType) {
111         this.contentType = contentType;
112     }
113
114
115     /** <p>Retrieves the HTML content body.<p>
116      *
117      * @return the HTML body content
118      */

119     final public String JavaDoc getContentBody() {
120         return contentBody;
121     }
122
123
124     /** <p>Sets the HTML content body.<p>
125      *
126      * @param contentBody the HTML content body
127      */

128     final public void setContentBody (String JavaDoc contentBody) {
129         this.contentBody = contentBody;
130     }
131 }
132
Popular Tags