Xindice API
version 1.1

org.apache.xindice.core
Class DocumentCache

java.lang.Object
  |
  +--org.apache.xindice.core.DocumentCache

public final class DocumentCache
extends Object

DocumentCache implements a simple Document caching system for Collections. FIXME: Revisit cache implementation. Most probably, commons collections' ReferenceMap should be used instead of WeakHashMap.

Version:
$Revision: 532556 $, $Date: 2007-04-25 21:18:26 -0400 (Wed, 25 Apr 2007) $

Constructor Summary
DocumentCache()
           
 
Method Summary
static int getCacheControl(org.w3c.dom.Document doc)
          Obtains value of the cache control processing instruction in this document
 org.w3c.dom.Document getDocument(Collection col, Key key)
          Obtains document from cache
 void putDocument(Collection col, Key key, byte[] bytes)
          Stores compressed document's bytes in the cache
 void putDocument(Collection col, Key key, String chars)
          Stores serialized document's text in the cache
 void removeDocument(Collection col, Key key)
          Remove document from the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCache

public DocumentCache()
Method Detail

getDocument

public org.w3c.dom.Document getDocument(Collection col,
                                        Key key)
Obtains document from cache
Parameters:
col - document collection
key - document key
Returns:
document from the cache or null if not present

putDocument

public void putDocument(Collection col,
                        Key key,
                        byte[] bytes)
Stores compressed document's bytes in the cache
Parameters:
col - document collection
key - document key
bytes - compressed document

putDocument

public void putDocument(Collection col,
                        Key key,
                        String chars)
Stores serialized document's text in the cache
Parameters:
col - document collection
key - document key
chars - uncompressed document

removeDocument

public void removeDocument(Collection col,
                           Key key)
Remove document from the cache
Parameters:
col - document collection
key - document key

getCacheControl

public static int getCacheControl(org.w3c.dom.Document doc)
Obtains value of the cache control processing instruction in this document
Parameters:
doc - document to inspect for cache control processing instruction
Returns:
cache control value

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.