1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.decoration;
18
19 /***
20 * Simple caching mechanism for storing pathed that were previously located
21 * by a <code>ResourceValidator</code>. This allows a Decoration to bypass
22 * hitting the ResourceValidator repeatedly after a path is already known
23 * to exist.
24 *
25 * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
26 *
27 * @see org.apache.jetspeed.decoration.ResourceValidator
28 *
29 */
30 public interface PathResolverCache
31 {
32 /***
33 * Adds a recolved <code>path</code> to the the cache using
34 * its relative path as the <code>key</code>
35 * @param key key relative path of the resource.
36 * @param path full path to resource
37 */
38 void addPath(String key, String path);
39
40 /***
41 * Returns a previously located path using its retlative path
42 * as the <code>code</code>.
43 *
44 * @param key relative path of the resource.
45 * @return full path to resource or <code>null</code> if no resource
46 * for the key exists.
47 */
48 String getPath(String key);
49
50 /***
51 * Removes a full path to a resource from the cache using its
52 * relative path as the <code>key</code>.
53 *
54 * @param key
55 * @return The full path to the resource or <code>null</code>
56 * if the resource path was not cached.
57 */
58 String removePath(String key);
59
60
61 /***
62 * Clears the entire contents of this cache object.
63 *
64 */
65 void clear();
66
67 }