KickJava   Java API By Example, From Geeks To Geeks.

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


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 Shared Modifications are Jahia View Helper.
30  *
31  * The Developer of the Shared Modifications is Jahia Solution Sarl.
32  * Portions created by the Initial Developer are Copyright (C) 2002 by the
33  * Initial Developer. All Rights Reserved.
34  *
35  * Contributor(s):
36  * ??-JUN-2003, Jahia Solutions Sarl, Fulco Houkes : Initial version
37  *
38  * ----- END LICENSE BLOCK -----
39  */

40
41
42 package org.jahia.services.cache;
43
44 import org.jahia.exceptions.JahiaInitializationException;
45 import org.jahia.settings.SettingsBean;
46
47 /** <p>This class implements a cache capable of caching HTML page and associate the pages
48  * to a page identification number and a user name.<p>
49  *
50  * <p>The cached pages can be remove by using either a page identification number or
51  * by specifying a user name. When invalidating pages through the
52  * {@link org.jahia.services.cache.HtmlCache#invalidatePageEntries invalidatePageEntries}
53  * method, all the pages holding the specified page ID will be removed, regardless of
54  * the related user name. The same is achieved by using the
55  * {@link org.jahia.services.cache.HtmlCache#invalidateUserEntries invalidateUserEntries}
56  * method, where all the pages associated to the specified username will be removed,
57  * regardless of the page IDs.</p>
58  *
59  * @author Fulco Houkes, Copyright (c) 2003 by Jahia Ltd.
60  * @author Serge Huber, Copyright (c) 2003 by Jahia Ltd.
61  * @version 1.0
62  * @since Jahia 4.0
63  *
64  * @see org.jahia.services.cache.Cache Cache
65  * @see org.jahia.services.cache.HtmlCacheEntry HtmlCacheEntry
66  */

67 public interface HtmlCache extends Cache {
68
69     // the HTML cache name.
70
public static final String JavaDoc HTML_CACHE = "HTMLCache";
71
72     public void init(SettingsBean jSettings) throws JahiaInitializationException;
73     
74     /**
75      * <p>Builds the cache key that is used to reference the cache entries in the
76      * lookup table.</p>
77      *
78      * <p>This method actually does much more in the case of user
79      * agent to group mappings. If the mapping doesn't exist yet, it creates it
80      * and if the automatic serialization mode is active, it saves the new user
81      * agent in the default group in the configuration file.</p>
82      *
83      * @param pageID the page identification number
84      * @param userName the user name
85      * @param languageCode the language code
86      * @param workflowState the workflow state
87      * @param userAgent the userAgent
88      *
89      * @return the generated cache key
90      */

91     public Object JavaDoc computeEntryKey (String JavaDoc pageID, String JavaDoc userName, String JavaDoc languageCode,
92                                           int workflowState, String JavaDoc userAgent, String JavaDoc scheme);
93     
94     /** <p>Invalidates all the cache entries related to the specified page <code>pageID</code>,
95      * by removing the cache entries.</p>
96      *
97      * <p><b>Caution</b>: depending of the HTML cache size, this operation can be
98      * time consumming!</p>
99      *
100      * @param pageID the page identification
101      */

102     public void invalidatePageEntries (String JavaDoc pageID);
103
104     /** <p>Invalidates all the cache entries related to the specified page <code>pageID</code>,
105      * by removing the cache entries.</p>
106      *
107      * <p><b>Caution</b>: depending of the HTML cache size, this operation can be
108      * time consumming!</p>
109      *
110      * @param pageID the page identification
111      */

112     public void invalidatePageEntries (String JavaDoc pageID, int workflowState);
113     
114     /** <p>Invalidates all the cache entries related to the specified user
115      * <code>username</code>, by removing the cache entries.</p>
116      *
117      * <p><b>Caution</b>: depending of the HTML cache size, this operation can be
118      * time consumming!</p>
119      *
120      * @param username the page identification
121      */

122     public void invalidateUserEntries (String JavaDoc username);
123 }
124
Popular Tags