Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PropertyPersistenceStrategySource |
|
| 1.0;1 |
1 | // Copyright 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.tapestry.record; | |
16 | ||
17 | import java.util.Collection; | |
18 | ||
19 | import org.apache.tapestry.engine.ServiceEncoding; | |
20 | ||
21 | /** | |
22 | * A source for {@link org.apache.tapestry.record.PropertyPersistenceStrategy}s. | |
23 | * | |
24 | * @author Howard M. Lewis Ship | |
25 | * @since 4.0 | |
26 | */ | |
27 | public interface PropertyPersistenceStrategySource | |
28 | { | |
29 | ||
30 | /** | |
31 | * Returns the name strategy. | |
32 | * | |
33 | * @param name | |
34 | * the name of the strategy to retrieve. | |
35 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
36 | * if no such strategy exists. | |
37 | */ | |
38 | PropertyPersistenceStrategy getStrategy(String name); | |
39 | ||
40 | /** | |
41 | * Returns all changes ({@link PropertyChange}) collected by any | |
42 | * persistence strategy for the page. May return an empty list. | |
43 | * | |
44 | * @see PropertyPersistenceStrategy#getStoredChanges(String) | |
45 | */ | |
46 | ||
47 | Collection getAllStoredChanges(String pageName); | |
48 | ||
49 | /** | |
50 | * Discards any stored property changes for the named page. | |
51 | */ | |
52 | ||
53 | void discardAllStoredChanged(String pageName); | |
54 | ||
55 | /** | |
56 | * Invoked by a {@link org.apache.tapestry.services.LinkFactory} , the | |
57 | * parameters may be modified (added to) to store information related to | |
58 | * persistent properties. This method is forwarded to all | |
59 | * {@link PropertyPersistenceStrategy}s. | |
60 | * | |
61 | * @param encoding | |
62 | * Service encoding, which indentifies the URL and the query | |
63 | * parameters from which the | |
64 | * {@link org.apache.tapestry.engine.ILink} will be created. | |
65 | * @param post | |
66 | * if true, then the link will be used for a post (not a get, | |
67 | * i.e., for a HTML form); this may affect what information is | |
68 | * encoded into the link | |
69 | * @see PropertyPersistenceStrategySource | |
70 | */ | |
71 | ||
72 | void addParametersForPersistentProperties(ServiceEncoding encoding, | |
73 | boolean post); | |
74 | } |