Clover coverage report - Code Coverage for tapestry release 4.0.1
Coverage timestamp: Fri Mar 31 2006 09:12:14 EST
file stats: LOC: 59   Methods: 0
NCLOC: 7   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
CookieSource.java - - - -
coverage
 1    // Copyright 2004, 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.services;
 16   
 17    /**
 18    * Used by other services to obtain cookie values for the current request.
 19    *
 20    * @author Howard Lewis Ship
 21    * @since 4.0
 22    */
 23    public interface CookieSource
 24    {
 25    /**
 26    * Returns the value of the first cookie whose name matches. Returns null if no such cookie
 27    * exists. This method is only aware of cookies that are part of the incoming request; it does
 28    * not know about additional cookies added since then (via
 29    * {@link #writeCookieValue(String, String)}).
 30    */
 31    String readCookieValue(String name);
 32   
 33    /**
 34    * Creates or updates a cookie value. The value is stored using a max age (in seconds) defined
 35    * by the symbol <code>org.apache.tapestry.default-cookie-max-age</code>. The factory default
 36    * for this value is the equivalent of one week.
 37    */
 38   
 39    void writeCookieValue(String name, String value);
 40   
 41    /**
 42    * As with {@link #writeCookieValue(String, String)} but an explicit maximum age may be set.
 43    *
 44    * @param name
 45    * the name of the cookie
 46    * @param value
 47    * the value to be stored in the cookie
 48    * @param maxAge
 49    * the maximum age, in seconds, to store the cookie
 50    */
 51   
 52    void writeCookieValue(String name, String value, int maxAge);
 53   
 54    /**
 55    * Removes a previously written cookie, by writing a new cookie with a maxAge of 0.
 56    */
 57   
 58    void removeCookieValue(String name);
 59    }