01: // CacheSerializer.java
02: // $Id: CacheSerializer.java,v 1.6 2000/08/16 21:38:03 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.www.protocol.http.cache;
07:
08: import java.io.IOException;
09: import java.io.Writer;
10: import java.io.Reader;
11:
12: import org.w3c.tools.resources.AttributeHolder;
13:
14: public abstract class CacheSerializer {
15:
16: /**
17: * Save a Generation, using a specified writer
18: * @param generation, a CacheGeneration, the generation to be saved
19: * @param writer, a Writer, the writer used to serialize this generation
20: */
21: public abstract void writeGeneration(CacheGeneration generation,
22: Writer writer) throws IOException;
23:
24: /**
25: * Save the list of generations (except the 'description' Generation)
26: * @param store, the Store to be dumped
27: * @param writer a Writer, used to dump
28: */
29: public abstract void writeGenerationList(CacheStore store)
30: throws IOException;
31:
32: /**
33: * Read a Generation, using a specified reader
34: * @param generation, a CacheGeneration, the generation to be saved
35: * @param reader, the Reader used to read this generation
36: */
37: public abstract CacheGeneration readGeneration(
38: CacheGeneration generation, Reader reader)
39: throws IOException;
40:
41: /**
42: * Read a Generation containing only CachedResourceDescription,
43: * using a specified reader.
44: * @param generation, a CacheGeneration, the generation to be 'loaded'
45: * @param reader, the Reader used to read this generation
46: */
47: public abstract CacheGeneration readDescription(
48: CacheGeneration generation, Reader reader)
49: throws IOException;
50:
51: /**
52: * Save an Attribute Holder
53: * @param holder, the attribute holder
54: * @param writer, a Writer, the writer used to serialize this generation
55: */
56: public abstract void write(AttributeHolder holder, Writer writer)
57: throws IOException;
58:
59: /**
60: * Read an Attribute Holder
61: * @param holder, the attribute holder
62: * @param reader, a Reader, the reader used to read the holder
63: */
64: public abstract AttributeHolder read(Reader reader)
65: throws IOException;
66:
67: }
|