");
}
String action = request.getParameter("action");
// out.write("Request action is: " + action);
if (action != null) {
if (label_1.equals(action)) {
// cache.clearEntries(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_ENTRIES))));
} else if (label_2.equals(action)) {
// cache.clear(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_ALL))));
} else if (label_6.equals(action)) {
// cache.clearOnline(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_ONLINE_ALL))));
} else if (label_5.equals(action)) {
// cache.clearOnlineEntries(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_ONLINE_ENTRIES))));
} else if (label_8.equals(action)) {
// cache.clearOffline(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_OFFLINE_ALL))));
} else if (label_7.equals(action)) {
// cache.clearOfflineEntries(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_OFFLINE_ENTRIES))));
} else if (label_9.equals(action)) {
// cache.purgeJspRepository(cms);
// cache.clear(cms);
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_PURGE_JSP_REPOSITORY, new HashMap(0), true));
A_OpenCms.fireCmsEvent(new CmsEvent(cms, I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.singletonMap("action", new Integer(CmsFlexCache.C_CLEAR_ENTRIES))));
}
}
if (cache != null) {
sizeEntries = cache.size();
sizeKeys = cache.keySize();
entryLruCache = cache.getEntryLruCache();
if (entryLruCache!=null) {
maxCacheByteSize = entryLruCache.getMaxCacheCosts();
avgCacheByteSize = entryLruCache.getAvgCacheCosts();
currentCacheByteSize = entryLruCache.getObjectCosts();
currentCacheObjectCount = entryLruCache.size();
}
}
%>
Entries in Flex Cache: <%=sizeEntries%>
Keys in Flex Cache: <%=sizeKeys%>
Max. size of all entries: <%=maxCacheByteSize%> bytes
Avg. size of all entries: <%=avgCacheByteSize%> bytes
Cur. size of all entries: <%=currentCacheByteSize%> bytes
<%
if ((action != null) && (cache != null)) {
if (label_3.equals(action) || label_4.equals(action)) {
boolean showall = false;
if (label_4.equals(action)) {
showall = true;
out.write("
Cached resources with keys and entries:
");
} else {
out.write("
Cached resources with keys:
");
}
Set set = cache.getCachedResources(cms);
if (cache.cacheOffline()) {
Set online = new TreeSet();
Set offline = new TreeSet();
Iterator i = set.iterator();
while(i.hasNext()) {
String resource = (String)i.next();
if (resource.endsWith(cache.C_CACHE_OFFLINESUFFIX)) {
offline.add(resource);
} else {
online.add(resource);
}
}
out.write("
Online resources:
");
i = online.iterator();
while(i.hasNext()) {
String resource = (String)i.next();
out.write("Resource: " + resource + " Key: " + cache.getCachedKey(resource, cms) + " ");
if (showall) {
Set variations = cache.getCachedVariations(resource, cms);
if (variations.size() > 0) {
Iterator s = variations.iterator();
while (s.hasNext()) {
String v = (String)s.next();
out.write(" Entry: " + v + " ");
}
}
}
}
if (online.size() == 0) out.write("There are no cached online resources!");
out.write("
Offline resources:
");
i = offline.iterator();
while(i.hasNext()) {
String resource = (String)i.next();
out.write("Resource: " + resource + " Key: " + cache.getCachedKey(resource, cms) + " ");
if (showall) {
Set variations = cache.getCachedVariations(resource, cms);
if (variations.size() > 0) {
Iterator s = variations.iterator();
while (s.hasNext()) {
String v = (String)s.next();
out.write(" Entry: " + v + " ");
}
}
}
}
if (offline.size() == 0) out.write("There are no cached offline resources!");
} else {
Iterator i = set.iterator();
while(i.hasNext()) {
String resource = (String)i.next();
out.write("Resource: " + resource + " Key: " + cache.getCachedKey(resource, cms) + " ");
if (showall) {
Set variations = cache.getCachedVariations(resource, cms);
if (variations.size() > 0) {
Iterator s = variations.iterator();
while (s.hasNext()) {
String v = (String)s.next();
out.write(" Entry: " + v + " ");
}
}
}
}
if (set.size() == 0) out.write("The cache is currently empty!");
}
}
}
%>