01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
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: * Adds a recolved <code>path</code> to the the cache using
33: * its relative path as the <code>key</code>
34: * @param key key relative path of the resource.
35: * @param path full path to resource
36: */
37: void addPath(String key, String path);
38:
39: /**
40: * Returns a previously located path using its retlative path
41: * as the <code>code</code>.
42: *
43: * @param key relative path of the resource.
44: * @return full path to resource or <code>null</code> if no resource
45: * for the key exists.
46: */
47: String getPath(String key);
48:
49: /**
50: * Removes a full path to a resource from the cache using its
51: * relative path as the <code>key</code>.
52: *
53: * @param key
54: * @return The full path to the resource or <code>null</code>
55: * if the resource path was not cached.
56: */
57: String removePath(String key);
58:
59: /**
60: * Clears the entire contents of this cache object.
61: *
62: */
63: void clear();
64:
65: }
|