Coverage Report - org.apache.tapestry.record.PropertyPersistenceStrategy
 
Classes in this File Line Coverage Branch Coverage Complexity
PropertyPersistenceStrategy
N/A
N/A
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  
  * Defines how a persistent property is made persistent. The typical
 23  
  * implementation is to store the persistent property into the session as a
 24  
  * session attribute.
 25  
  * 
 26  
  * @author Howard M. Lewis Ship
 27  
  * @since 4.0
 28  
  */
 29  
 public interface PropertyPersistenceStrategy
 30  
 {
 31  
 
 32  
     /**
 33  
      * Stores the new value.
 34  
      * 
 35  
      * @param pageName
 36  
      *            the name of the page containing the property
 37  
      * @param idPath
 38  
      *            the path to the component with the property (may be null)
 39  
      * @param propertyName
 40  
      *            the name of the property to be persisted
 41  
      * @param newValue
 42  
      *            the new value (which may be null)
 43  
      */
 44  
 
 45  
     void store(String pageName, String idPath, String propertyName,
 46  
             Object newValue);
 47  
 
 48  
     /**
 49  
      * Returns a collection of {@link org.apache.tapestry.record.PropertyChange}s.
 50  
      * These represent prior changes previously stored. The order is not
 51  
      * significant. Must not return null. Does not have to reflect changes made
 52  
      * during the current request (this method is typically invoked as part of
 53  
      * rolling back a page to a prior state, before any further changes are
 54  
      * possible).
 55  
      */
 56  
 
 57  
     Collection getStoredChanges(String pageName);
 58  
 
 59  
     /**
 60  
      * Invoked to discard any stored changes for the specified page.
 61  
      */
 62  
     void discardStoredChanges(String pageName);
 63  
 
 64  
     /**
 65  
      * Invoked by a {@link org.apache.tapestry.services.LinkFactory} , the
 66  
      * parameters may be modified (added to) to store information related to
 67  
      * persistent properties. This method is forwarded to all
 68  
      * {@link PropertyPersistenceStrategy}s.
 69  
      * 
 70  
      * @param encoding
 71  
      *            Service encoding, which indentifies the URL and the query
 72  
      *            parameters from which the
 73  
      *            {@link org.apache.tapestry.engine.ILink} will be
 74  
      *            created.
 75  
      * @param post
 76  
      *            if true, then the link will be used for a post (not a get,
 77  
      *            i.e., for a HTML form); this may affect what information is
 78  
      *            encoded into the link
 79  
      * @see PropertyPersistenceStrategySource
 80  
      */
 81  
 
 82  
     void addParametersForPersistentProperties(ServiceEncoding encoding,
 83  
             boolean post);
 84  
 }