changeset 217:9f596e9ab6fb

digilib directory cache information
author robcast
date Tue, 29 Jun 2004 12:06:37 +0200
parents 050fa739066f
children 0dd38cb2961f
files client/digitallibrary/server/dlCache.jsp
diffstat 1 files changed, 73 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/server/dlCache.jsp	Tue Jun 29 12:06:37 2004 +0200
@@ -0,0 +1,73 @@
+<%@ page language="java" %>
+
+<%!
+// authentication stuff - robert
+// -----------------------------
+// create DocumentBean instance for all JSP requests
+digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
+
+// initialize DocumentBean instance in JSP init
+public void jspInit() {
+    try {
+        // set servlet init-parameter
+        docBean.setConfig(getServletConfig());
+    } catch (javax.servlet.ServletException e) {
+        System.out.println(e);
+    }
+}
+%>
+
+<%
+// get digilib config
+digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
+// dir cache
+digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");
+%>
+
+<html>
+<head>
+<title>Digilib cache info</title>
+</head>
+
+<h1>Digilib cache info</h1>
+
+
+ <table>
+  <tr>
+	<td>size (directories)</td><td><b><%= dirCache.size() %></b></td>
+    <td></td>
+  </tr>
+  <tr>
+	<td>numFiles</td><td><b><%= dirCache.getNumFiles() %></b></td>
+    <td></td>
+  </tr>
+  <tr>
+	<td>hits</td><td><b><%= dirCache.getHits() %></b></td>
+    <td></td>
+  </tr>
+  <tr>
+	<td>misses</td><td><b><%= dirCache.getMisses() %></b></td>
+    <td></td>
+  </tr>
+</table>
+
+<table>
+<%
+    Object[] keys = dirCache.getChildren("", true).toArray();
+    java.util.Arrays.sort(keys);
+    int l = keys.length;
+    for (int i = 0; i < l; i++) {
+	String key = (String) keys[i];
+	//	digilib.io.DocuDirectory val = (digilib.io.DocuDirectory) dirCache.getDirectory(key);
+%>
+  <tr>
+       <td valign="top"><%= key %></td><td><b><%= 1 /* val.getDirName() */ %></b></td>
+    <td></td>
+  </tr>
+<%
+       }
+%>
+</table>
+
+</body>
+</html>