01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.caching;
17:
18: import org.geotools.data.DataStore;
19:
20: /** a DataCache is a DataStore that takes its features from another DataStore,
21: * and tries to remember them in order to leverage subsequent related queries.
22: * This is more of a marker interface, as a DataCache should behave in the same manner
23: * as the source DataStore, but hopefully faster ...
24: *
25: * @author Christophe Rousson, SoC 2007, CRG-ULAVAL
26: *
27: */
28: public interface DataCache extends DataStore {
29: /** Reset the cache,
30: * so it does not remember any of the features that were stored.
31: */
32: public abstract void clear();
33:
34: /** Cause the cache to write back any of dirty features it may contain.
35: * Could be better in a subinterface for async read-write caches.
36: */
37: public abstract void flush() throws IllegalStateException;
38:
39: /** Provide a simple statistic of how many times
40: * the cache was queried in place of the source DataStore.
41: * Probably not useful.
42: *
43: * @task remove this method.
44: */
45: public abstract long getHits();
46: }
|