org.w3c.www.protocol.http.cache
Class SimpleCacheSerializer

java.lang.Object
  extended by org.w3c.www.protocol.http.cache.CacheSerializer
      extended by org.w3c.www.protocol.http.cache.SimpleCacheSerializer

public class SimpleCacheSerializer
extends CacheSerializer


Field Summary
protected  XMLSerializer serializer
           
 
Constructor Summary
SimpleCacheSerializer()
           
 
Method Summary
 AttributeHolder read(java.io.Reader reader)
          Read an Attribute Holder
 CacheGeneration readDescription(CacheGeneration generation, java.io.Reader reader)
          Read a Generation containing only CachedResourceDescription, using a specified reader.
 CacheGeneration readGeneration(CacheGeneration generation, java.io.Reader reader)
          Read a Generation, using a specified reader
 void write(AttributeHolder holder, java.io.Writer writer)
          Save an Attribute Holder
 void writeGeneration(CacheGeneration generation, java.io.Writer writer)
          Save a Generation, using a specified writer
 void writeGenerationList(CacheStore store)
          Save the list of generations (except the 'description' Generation)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serializer

protected XMLSerializer serializer
Constructor Detail

SimpleCacheSerializer

public SimpleCacheSerializer()
Method Detail

writeGeneration

public void writeGeneration(CacheGeneration generation,
                            java.io.Writer writer)
                     throws java.io.IOException
Save a Generation, using a specified writer

Specified by:
writeGeneration in class CacheSerializer
Parameters:
generation, - a CacheGeneration, the generation to be saved
writer, - a Writer, the writer used to serialize this generation
Throws:
java.io.IOException

writeGenerationList

public void writeGenerationList(CacheStore store)
                         throws java.io.IOException
Save the list of generations (except the 'description' Generation)

Specified by:
writeGenerationList in class CacheSerializer
Parameters:
store, - the Store to be dumped
writer - a Writer, used to dump
Throws:
java.io.IOException

readGeneration

public CacheGeneration readGeneration(CacheGeneration generation,
                                      java.io.Reader reader)
                               throws java.io.IOException
Read a Generation, using a specified reader

Specified by:
readGeneration in class CacheSerializer
Parameters:
generation, - a CacheGeneration, the generation to be loaded (or updated)
reader, - the Reader used to read this generation
Throws:
java.io.IOException

readDescription

public CacheGeneration readDescription(CacheGeneration generation,
                                       java.io.Reader reader)
                                throws java.io.IOException
Read a Generation containing only CachedResourceDescription, using a specified reader.

Specified by:
readDescription in class CacheSerializer
Parameters:
generation, - a CacheGeneration, the generation to be 'loaded'
reader, - the Reader used to read this generation
Throws:
java.io.IOException

write

public void write(AttributeHolder holder,
                  java.io.Writer writer)
           throws java.io.IOException
Save an Attribute Holder

Specified by:
write in class CacheSerializer
Parameters:
holder, - the attribute holder
writer, - a Writer, the writer used to serialize this generation
Throws:
java.io.IOException

read

public AttributeHolder read(java.io.Reader reader)
                     throws java.io.IOException
Read an Attribute Holder

Specified by:
read in class CacheSerializer
Parameters:
holder, - the attribute holder
reader, - a Reader, the reader used to read the holder
Throws:
java.io.IOException